home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / mail / sendmail / UCB / sendmail.8.6.5.patch.Z / sendmail.8.6.5.patch
Encoding:
Text File  |  1994-01-12  |  329.5 KB  |  12,047 lines

  1. *** KNOWNBUGS.OLD    Sun Nov  7 10:28:55 1993
  2. --- KNOWNBUGS    Wed Jan 12 06:00:44 1994
  3. ***************
  4. *** 1,7 ****
  5.   
  6.   
  7.            K N O W N   B U G S   I N   S E N D M A I L
  8. !                  (for 8.6.3)
  9.   
  10.   
  11.   The following are bugs or deficiencies in sendmail that I am aware of
  12. --- 1,7 ----
  13.   
  14.   
  15.            K N O W N   B U G S   I N   S E N D M A I L
  16. !                  (for 8.6.5)
  17.   
  18.   
  19.   The following are bugs or deficiencies in sendmail that I am aware of
  20. ***************
  21. *** 9,23 ****
  22.   want to get the most up to date version of this from FTP.CS.Berkeley.EDU
  23.   in /ucb/sendmail/KNOWNBUGS.
  24.   
  25. ! * "SYSERR: openmailer(local): fd 1 not open" message
  26.   
  27. -   File descriptor 1 (standard output) should not be closed during normal
  28. -   processing.  This is checked periodically, and sometimes this condition
  29. -   is found and this message is produced.  Sendmail repairs the problem,
  30. -   and the mail is still delivered, but I still don't know why it happens.
  31. -   (There was a bug that was fixed in 8.6.beta.13 that might be related,
  32. -   but I think this bug still exists.)
  33.   
  34.   * Null bytes are not handled properly.
  35.   
  36.     Sendmail should handle full binary data.  As it stands, it handles
  37. --- 9,25 ----
  38.   want to get the most up to date version of this from FTP.CS.Berkeley.EDU
  39.   in /ucb/sendmail/KNOWNBUGS.
  40.   
  41. ! This list is not guaranteed to be complete, especially for fixed bugs.
  42. ! Many bugs are reported and fixed without ever making it as far as this
  43. ! file.  See the file RELEASE_NOTES (in the root directory of the sendmail
  44. ! distribution) for more details.
  45.   
  46.   
  47. + +----------------------------------------------+
  48. + | THE FOLLOWING PROBLEMS ARE STILL OUTSTANDING |
  49. + +----------------------------------------------+
  50.   * Null bytes are not handled properly.
  51.   
  52.     Sendmail should handle full binary data.  As it stands, it handles
  53. ***************
  54. *** 26,37 ****
  55.     restructuring of the code -- for example, almost no C library support
  56.     could be used to handle strings.
  57.   
  58. - * Route-addrs missing angle brackets.
  59. -   There are cases where route-addrs do not get angle brackets around them,
  60. -   such as in the "-r" flag on mailers or in the From_ line created when
  61. -   mailing to files.
  62.   * Duplicate error messages.
  63.   
  64.     Sometimes identical, duplicate error messages can be generated.  As
  65. --- 28,33 ----
  66. ***************
  67. *** 56,59 ****
  68.     this address.  It's not clear what the right behaviour is in this
  69.     circumstance.
  70.   
  71. ! (Version 8.9, last updated 10/31/93)
  72. --- 52,171 ----
  73.     this address.  It's not clear what the right behaviour is in this
  74.     circumstance.
  75.   
  76. ! * REDIRECT aliases don't work with `n' option.
  77. !   If you have option `n' set when you use newaliases and have
  78. !   REDIRECT addresses in your aliases file, you'll get the error
  79. !   messages during the newaliases instead of when email is sent to
  80. !   the address in question.  The workaround is to turn off the `n'
  81. !   option.
  82. ! * MX records that point at non-existent hosts work strangly.
  83. !   Consider the DNS records:
  84. !     hostH    MX    1 hostA
  85. !         MX    2 hostB
  86. !     hostA    A    128.32.8.9
  87. !   (note that there is no A record for hostB).  If hostA is down,
  88. !   an attempt to send to hostH gives "host unknown" -- that is, it
  89. !   reflects out the status on the last host it tries, which in this
  90. !   case is hostB, which is unknown.  It probably ought to eliminate
  91. !   hostB early in processing.
  92. ! * NAME environment variables with commas break.
  93. !   If you define your NAME environment variable to have a comma
  94. !   (e.g., ``Lastname, Firstname''), and you are using the $q definition
  95. !   that uses ``name <address>'' format, sendmail treats the first and
  96. !   last names as two addresses, thus producing a bogus From line.  You
  97. !   can work around this by changing the $q definition to use
  98. !   ``address (name)''.
  99. ! * \231 considered harmful.
  100. !   Header addresses that have the \231 character (and possibly others
  101. !   in the range \201 - \237) behave in odd and usually unexpected ways.
  102. ! * DEC Alphas (OSF/1 1.3) sometimes time out on sending mail.
  103. !   I have one report that DEC Alphas acting as SMTP clients sometimes
  104. !   will apparently not see the "250 OK" message in response to the
  105. !   dot that indicates the end of the message.  This only happens if
  106. !   the message is run from the queue -- if it gets through on first
  107. !   try, everything is fine.  I have been unable to reproduce this
  108. !   problem at Berkeley.
  109. ! * accept() problem on SVR4.
  110. !   Apparently, the sendmail daemon loop (doing accept()s on the network)
  111. !   can get into a wierd state on SVR4; it starts logging ``SYSERR:
  112. !   getrequests: accept: Protocol Error''.  The workaround is to kill
  113. !   and restart the sendmail daemon.  We don't have an SVR4 system at
  114. !   Berkeley that carries more than token mail load, so I can't validate
  115. !   this.  It is likely to be a glitch in the sockets emulation, since
  116. !   "Protocol Error" is not possible error code with Berkeley TCP/IP.
  117. !   I've also had someone report the message ``sendmail: accept:
  118. !   SIOCGPGRP failed errno 22'' on an SVR4 system.  This message is
  119. !   not in the sendmail source code, so I assume it is also a bug
  120. !   in the sockets emulation.  (Errno 22 is EINVAL "Invalid Argument"
  121. !   on all the systems I have available, including Solaris 2.x.)
  122. ! * Sending user deletion not done properly in :include: lists.
  123. !   If you don't have the "m" (me too) option set, then a person
  124. !   sending to a list that contains themselves should not get a copy
  125. !   of the message.  However, if that list points to a :include: file
  126. !   that has one address per line, this will break, and the sender
  127. !   will always get a copy of their own message, just as though the
  128. !   "m" option were set.
  129. !   You can eliminate this by adding commas at the end of each line
  130. !   of the :include: file.
  131. ! +-------------------------------------------+
  132. ! | THE FOLLOWING PROBLEMS ARE FIXED IN 8.6.5 |
  133. ! +-------------------------------------------+
  134. ! * Route-addrs missing angle brackets.
  135. !   There are cases where route-addrs do not get angle brackets around them,
  136. !   such as in the "-r" flag on mailers or in the From_ line created when
  137. !   mailing to files.
  138. ! * No "exposed users" in "nullrelay" configuration.
  139. !   The "nullrelay" configuration hides all addresses behind the mail
  140. !   hub name.  Some sites might prefer to expose some names such as
  141. !   root.  This information is always available in Received: lines.
  142. ! * owner-* alias that uses :include: broken.
  143. !   If you have aliases set up as:
  144. !     owner-listname:        :include:/some/file
  145. !   sendmail will break because it considers this a "sender address",
  146. !   which is not permitted to use the :include: syntax.  The easiest
  147. !   workaround is to change this to:
  148. !     owner-listname:        :include:/some/file,
  149. !   (note the trailing comma); a somewhat cleaner solution is to use:
  150. !     owner-listname:        listname-request
  151. !     listname-request:    :include:/some/file
  152. ! * "SYSERR: openmailer(local): fd 1 not open" message
  153. !   File descriptor 1 (standard output) should not be closed during normal
  154. !   processing.  This is checked periodically, and sometimes this condition
  155. !   is found and this message is produced.  Sendmail repairs the problem,
  156. !   and the mail is still delivered, but I still don't know why it happens.
  157. !   (There was a bug that was fixed in 8.6.beta.13 that might be related,
  158. !   but I think this bug still exists.)
  159. ! (Version 8.15, last updated 1/12/94)
  160. *** READ_ME.OLD    Thu Nov 25 07:55:57 1993
  161. --- READ_ME    Tue Jan  4 07:52:09 1994
  162. ***************
  163. *** 1,5 ****
  164.   /*-
  165. !  *    @(#)READ_ME    8.5 (Berkeley) 9/28/93
  166.    */
  167.   
  168.               SENDMAIL RELEASE 8
  169. --- 1,5 ----
  170.   /*-
  171. !  *    @(#)READ_ME    8.8 (Berkeley) 1/4/94
  172.    */
  173.   
  174.               SENDMAIL RELEASE 8
  175. ***************
  176. *** 41,46 ****
  177. --- 41,83 ----
  178.   macro set that is compatible with these macros.
  179.   
  180.   
  181. + +-----------------------+
  182. + | RELATED DOCUMENTATION |
  183. + +-----------------------+
  184. + There are other files you should read.  Rooted in this directory are:
  185. +   CHANGES-R5-R8
  186. +     Describes changes between Release 5 and Release 8 of sendmail.
  187. +     There are some things that may behave somewhat differently.
  188. +     For example, the rules governing when :include: files will
  189. +     be read have been tightened up for security reasons.
  190. +   FAQ
  191. +     Answers to Frequently Asked Questions.
  192. +   KNOWNBUGS
  193. +     Known bugs in the current release.  I try to keep this up
  194. +     to date -- get the latest version from FTP.CS.Berkeley.EDU
  195. +     in /ucb/sendmail/KNOWNBUGS.
  196. +   RELEASE_NOTES
  197. +     A detailed description of the changes in each version.  This
  198. +     is quite long, but informative.
  199. +   src/READ_ME
  200. +     Details on compiling and installing sendmail.
  201. +   cf/README
  202. +     Details on configuring sendmail.
  203. +   doc/op/op.me
  204. +     The sendmail Installation & Operations Guide.  Be warned: if
  205. +     you are running this off on SunOS or some other system with an
  206. +     old version of -me, you need to add the following macro to the
  207. +     macros:
  208. +         .de sm
  209. +         \s-1\\$1\\s0\\$2
  210. +         ..
  211. +     This sets a word in a smaller pointsize.
  212.   +--------------+
  213.   | RELATED RFCS |
  214.   +--------------+
  215. ***************
  216. *** 96,101 ****
  217. --- 133,169 ----
  218.   faster, and the interface is nicer to animals and plants.  You will
  219.   also probably find that you have to add -I/where/you/put/db/include
  220.   to the sendmail makefile to get db.h to work properly.
  221. + +-------------+
  222. + | USE WITH MH |
  223. + +-------------+
  224. + This version of sendmail notices and reports certain kinds of SMTP
  225. + protocol violations that were ignored by older versions.  If you
  226. + are running MH you may wish to install the patch in contrib/mh.patch
  227. + that will prevent these warning reports.  This patch also works
  228. + with the old version of sendmail, so it's safe to go ahead and
  229. + install it.
  230. + +-----------+
  231. + | MAKEFILES |
  232. + +-----------+
  233. + The Makefiles in this release use the new Berkeley "make" that is
  234. + available in BSD Net/2 and 4.4BSD.  If you are using this version
  235. + of make, you may notice one or two places where the Makefile includes
  236. + "../../Makefile.inc".  This file is not included with the sendmail
  237. + distribution because it's not part of sendmail.  However, it is,
  238. + in toto:
  239. +     #    @(#)Makefile.inc    8.1 (Berkeley) 6/6/93
  240. +     BINDIR?=    /usr/sbin
  241. + The other directories should all have Makefile.dist files that work
  242. + on the old make.  For more details, see src/READ_ME.
  243.   
  244.   
  245.   +---------------------+
  246. *** RELEASE_NOTES.OLD    Sun Nov  7 10:29:11 1993
  247. --- RELEASE_NOTES    Thu Jan 13 06:45:11 1994
  248. ***************
  249. *** 1,3 ****
  250. --- 1,287 ----
  251. + 8.6.5/8.6.5    94/01/13
  252. +     Security fix:  /.forward could be owned by anyone (the test
  253. +         to allow root to own any file was backwards).  From
  254. +         Bob Campbell at U.C. Berkeley.
  255. +     Security fix: group ids were not completely set when programs
  256. +         were invoked.  This caused programs to have group
  257. +         permissions they should not have had (usually group
  258. +         daemon instead of their own group).  In particular,
  259. +         Perl scripts would refuse to run.
  260. +     Security: check to make sure files that are written are not
  261. +         symbolic links (at least under some circumstances).
  262. +         Although this does not respond to a specific known
  263. +         attack, it's just a good idea.  Suggested by
  264. +         Christian Wettergren.
  265. +     Security fix: if a user had an NFS mounted home directory on
  266. +         a system with a restricted shell listed in their
  267. +         /etc/passwd entry, they could still execute any
  268. +         program by putting that in their .forward file.
  269. +         This fix prevents that by insisting that their shell
  270. +         appear in /etc/shells before allowing a .forward to
  271. +         execute a program or write a file.  You can disable
  272. +         this by putting "*" in /etc/shells.  It also won't
  273. +         permit world-writable :include: files to reference
  274. +         programs or files (there's no way to disable this).
  275. +         These behaviours are only one level deep -- for
  276. +         example, it is legal for a world-writable :include:
  277. +         file to reference an alias that writes a file, on
  278. +         the assumption that the alias file is well controlled.
  279. +     Security fix: root was not treated suspiciously enough when
  280. +         looking into subdirectories.  This would potentially
  281. +         allow a cracker to examine files that were publically
  282. +         readable but in a non-publically searchable directory.
  283. +     Fix a problem that causes an error on QUIT on a cached
  284. +         connection to create problems on the current job.
  285. +         These are typically unrelated, so errors occur in
  286. +         the wrong place.
  287. +     Reset CurrentLA in sendall() -- this makes sendmail queue
  288. +         runs more responsive to load average, and fixes a
  289. +         problem that ignored the load average in locally
  290. +         generated mail.  From Eric Wassenaar.
  291. +     Fix possible core dump on aliases with null LHS.  From
  292. +         John Orthoefer of BB&N.
  293. +     Revert to using flock() whenever possible -- there are just
  294. +         too many bugs in fcntl() locking, particularly over
  295. +         NFS, that cause sendmail to fail in perverse ways.
  296. +     Fix a bug that causes the connection cache to get confused
  297. +         when sending error messages.  This resulted in
  298. +         "unexpected close" messages.  It should fix itself
  299. +         on the following queue run.  Problem noted by
  300. +         Liudvikas Bukys of Rochester University.
  301. +     Include $k in $=k as documented in the Install & Op Guide.
  302. +         This seems odd, but it was documented....  From
  303. +         Michael Corrigan of UCSD.
  304. +     Fix problem that caused :include:s from alias files to be
  305. +         forced to be owned by root instead of daemon
  306. +         (actually DefUid).  From Tim Irvin.
  307. +     Diagnose unrecognized I option values -- from Mortin Forssen
  308. +         of the Chalmers University of Technology.
  309. +     Make "error" mailer work consistently when there is no error
  310. +         code associated with it -- previously it returned OK
  311. +         even though there was a real problem.  Now it assumes
  312. +         EX_UNAVAILABLE.
  313. +     Fix bug that caused the last header line of messages that had
  314. +         no body and which were terminated with EOF instead of
  315. +         "." to be discarded.  Problem noted by Liudvikas Bukys.
  316. +     Fix core dump on SMTP mail to programs that failed -- it tried
  317. +         to go to a "next MX host" when none existed, causing
  318. +         a core dump.  From der Mouse at McGill University.
  319. +     Change IDENTPROTO from a defined/not defined to a 0/1 switch;
  320. +         this makes it easier to turn it off (using
  321. +         -DIDENTPROTO=0 in the Makefile).  From der Mouse.
  322. +     Fix YP_MASTER_NAME store to use the unupdated result of
  323. +         gethostname() (instead of myhostname(), which tries
  324. +         to fully qualify the name) to be consistent with
  325. +         SunOS.  If your hostname is unqualified, this fixes
  326. +         transfers to slave servers.  Bug noted by Keith
  327. +         McMillan of Ameritech Services, Inc.
  328. +     Fix Ultrix problem: gethostbyname() can return a very large
  329. +         (> 500) h_length field, which causes the sockaddr
  330. +         to be trashed.  Use the size of the sockaddr instead.
  331. +         Fix from Bob Manson of Ohio State.
  332. +     Don't assume "-a." on host lookups if NAMED_BIND is not
  333. +         defined -- this confuses gethostbyname on hosts
  334. +         file lookups, which doesn't understand the trailing
  335. +         dot convention.
  336. +     Log SMTP server subprocesses that die with a signal instead
  337. +         of from a clean exit.
  338. +     If you don't have option "I" set, don't assume that a DNS
  339. +         "host unknown" message is authoritative -- it
  340. +         might still be found in /etc/hosts.
  341. +     Fix a problem that would cause Deferred: messages to be sent
  342. +         as the subject of an error message, even though the
  343. +         actual cause of a message was more severe than that.
  344. +         Problem noted by Chris Seabrook of OSSI.
  345. +     Fix race condition in DBM alias file locking.  From Kyle
  346. +         Jones of UUNET.
  347. +     Limit delivery syslog line length to avoid bugs in some
  348. +         versions of syslog(3).  This adds a new compile time
  349. +         variable SYSLOG_BUFSIZE.  From Jay Plett of Princeton
  350. +         University, which is in turn derived from IDA.
  351. +     Fix quotes inside of comments in addresses -- previously
  352. +         it insisted that they be balanced, but the 822 spec
  353. +         says that they should be ignored.
  354. +     Dump open file state to syslog upon receiving SIGUSR1 (for
  355. +         debugging).  This also evaluates ruleset 89, if set
  356. +         (with the null input), and logs the result.  This
  357. +         should be used sparingly, since the rewrite process
  358. +         is not reentrant.
  359. +     Change -qI, -qR, and -qS flags to be case-insensitive as
  360. +         documented in the Bat Book.
  361. +     If the mailer returned EX_IOERR or EX_OSERR, sendmail did not
  362. +         return an error message and did not requeue the message.
  363. +         Fix based on code from Roland Dirlewanger of
  364. +         Reseau Regional Aquarel, Bordeaux, France.
  365. +     Fix a problem that caused a seg fault if you got a 421 error
  366. +         code during some parts of connection initialization.
  367. +         I've only seen this when talking to buggy mailers on
  368. +         the other end, but it shouldn't give a seg fault in
  369. +         any case.  From Amir Plivatsky.
  370. +     Fix core dump caused by a ruleset call that returns null.
  371. +         Fix from Bryan Costales of ICSI.
  372. +     Full-Name: field was being ignored.  Fix from Motonori Nakamura
  373. +         of Kyoto University.
  374. +     Fix a possible problem with very long input lines in setproctitle.
  375. +         From P{r Emanuelsson.
  376. +     Avoid putting "This is a warning message" out on return receipts.
  377. +         Suggested by Douglas Anderson.
  378. +     Detect loops caused by recursive ruleset calls.  Suggested by
  379. +         Bryan Costales.
  380. +     Initialize non-alias maps during alias rebuilds -- they may be
  381. +         needed for parsing.  Problem noted by Douglas Anderson.
  382. +     Log sender address even if no message was collected in SMTP
  383. +         (e.g., if all RCPTs failed).  Suggested by Motonori
  384. +         Nakamura.
  385. +     Don't reflect the owner-list contents into the envelope sender
  386. +         address if the value contains ", :, /, or | (to avoid
  387. +         illegal addresses appearing there).
  388. +     Efficiency hack for toktype macro -- from Craig Partridge of
  389. +         BB&N.
  390. +     Clean up DNS error printing so that a host name is always
  391. +         included.
  392. +     Remember to set $i during queue runs.  Reported by Stephen
  393. +         Campbell of Dartmouth University.
  394. +     If ${HOSTALIASES} is set, use it during canonification so that
  395. +         headers are properly mapped.  Reported by Anne Bennett
  396. +         of Concordia University.
  397. +     Avoid printing misleading error message if SMTP mailer (not
  398. +         using [IPC]) should die on a core dump.
  399. +     Avoid incorrect diagnosis of "file 1 closed" when it is caused
  400. +         by the other end closing the connection.  From
  401. +         Dave Morrison of Oracle.
  402. +     Improve several of the error messages printed by "mailq"
  403. +         to include a host name or other useful information.
  404. +     Add preliminary NetInfo support for NeXT systems.  From Vince
  405. +         DeMarco.
  406. +     Fix a glitch that sometimes caused :include:s that pointed to
  407. +         NFS filesystems that were down to give an "aliasing/
  408. +         forwarding loop broken" message instead of queueing
  409. +         the message for retry.  Noted by William C Fenner of
  410. +         the NRL Connection Machine Facility.
  411. +     Fix a problem that could cause a core dump if the input sequence
  412. +         had (or somehow acquired) a \231 character.
  413. +     Make sure that route-addrs always have <angle brackets> around
  414. +         them in non-SMTP envelopes (SMTP envelopes already do
  415. +         this properly).
  416. +     Avoid wierd headers on unbalanced punctuation of the form:
  417. +         ``Joe User <user)'' -- this caused reference to the
  418. +         null macro.  Fix from Rick McCarty of IO.COM.
  419. +     Fix a problem that caused an alias "user: user@local.host" to
  420. +         not have the QNOTREMOTE bit set; this caused configs
  421. +         to act as if FEATURE(notsticky) was defined even when
  422. +         it was not.  The effect of the problem was to make it
  423. +         very hard to to set up satellite sites that had a few
  424. +         local accounts, with everything else forwarded to a
  425. +         corporate hub.  Reported by Detlef Drewanz of the
  426. +         University of Rostock and Mark Frost of NCD.
  427. +     Change queuing to not call rulesets 3, {1 or 2}, 4 on header
  428. +         addresses.  This is more efficient (fewer name server
  429. +         calls) and fixes certain unusual configurations, such
  430. +         as those that have ruleset 4 do something that is
  431. +         non-idempotent unless a mailer-specific ruleset did
  432. +         something else.  Problem reported by Brian J. Coan
  433. +         of the Institute for Global Communications.
  434. +     Fix the "obsolete argument" routine in main to better understand
  435. +         new arguments.  For example, if you used ``sendmail
  436. +         -C config -v -q'' it would choke on the -q because
  437. +         the -C would stop looking for old-format arguments.
  438. +     Portability fixes for:
  439. +         SCO UNIX from Murray Kucherawy.
  440. +         SCO Open Server 3.2v4 from Philippe Brand.
  441. +         System V Release 4 from Rick Ellis and others.
  442. +         OSF/1 from Steve Campbell.
  443. +         DG/UX from Ben Mesander of the USGS and Bryan Curnutt
  444. +             of Stoner Associates.
  445. +         Motorola SysV88 from Kevin Johnson of Motorola.
  446. +         Solaris 2.3 from Casper H.S. Dik of the University
  447. +             of Amsterdam and John Caruso of University
  448. +             of Maryland.
  449. +         FreeBSD from Ollivier Robert.
  450. +         NetBSD from Adam Glass.
  451. +         TitanOS from Kate Hedstrom of Rutgers University.
  452. +         Irix from Bryan Curnutt.
  453. +         Dynix from Jim Davis of the University of Arizona.
  454. +         RISC/os.
  455. +         Linux from John Kennedy of California State University
  456. +             at Chico.
  457. +         Solaris 2.x from Tony Boner of the U.S. Air Force.
  458. +         NEXTSTEP 3.x from Vince DeMarco.
  459. +         HP-UX from various people.  NOTA BENE:  the location
  460. +             of the config file has moved to /usr/lib
  461. +             to match the HP-UX version of sendmail.
  462. +     CONFIG: Don't do any recipient rewriting on relay mailer;
  463. +         since this is intended only for internal use, the
  464. +         usual RFC 821/822/1123 rules can be relaxed.  The
  465. +         main point of this is to avoid munging (ugh) UUCP
  466. +         addresses when relaying internally.
  467. +     CONFIG: fix typo in mailer/uucp.m4 that mutilates list:;
  468. +         syntax addresses delivered via UUCP.  Solution
  469. +         provided by Peter Wemm.
  470. +     CONFIG: fix thumb-fumble in default UUCP relaying in ruleset
  471. +         zero; it caused double @ signs in addresses.  From
  472. +         Irving Reid of the University of Toronto.
  473. +     CONFIG: Portability fixes for SCO Unix 3.2 with TCP/IP 1.2.1
  474. +         from Markku Toijala of ICL Personal Systems Oy.
  475. +     CONFIG: Add trailing "." on pseudo-domains for consistency;
  476. +         this fixes a problem (noted by Al Whaley of Sunnyside)
  477. +         that made it hard to recognize your own pseudodomain
  478. +         names.
  479. +     CONFIG: catch "@host" syntax errors (i.e., null local-parts)
  480. +         rather than letting them get "local configuration
  481. +         error"s.  Problem noted by John Gardiner Myers.
  482. +     CONFIG: add uucp-uudom mailer variant, based on code posted
  483. +         by Spider Boardman <spider@Orb.Nashua.NH.US>; this
  484. +         has uucp-dom semantics but old UUCP syntax.  This
  485. +         also permits "uucp-old" as an alias for "uucp" and
  486. +         "uucp-new" as a synonym for "suucp" for consistency.
  487. +     CONFIG: add POP mailer support (from Kimmo Suominen
  488. +         <kim@grendel.lut.fi>).
  489. +     CONFIG: drop CSNET_RELAY support -- CSNET is long gone.
  490. +     CONFIG: fix bug caused with domain literal addresses (e.g.,
  491. +         ``[128.32.131.12]'') when FEATURE(allmasquerade)
  492. +         was set; it would get an additional @masquerade.host
  493. +         added to the address.  Problem noted by Peter Wan
  494. +         of Georgia Tech.
  495. +     CONFIG: make sure that the local UUCP name is in $=w.  From
  496. +         Jim Murray of Stratus.
  497. +     CONFIG: changes to UUCP rewriting to simulate IDA-style "V"
  498. +         mailer flag.  Briefly, if you are sending to host
  499. +         "foo", then it rewrites "foo!...!baz" to "...!baz",
  500. +         "foo!baz" remains "foo!baz", and anything else has
  501. +         the local name prepended.
  502. +     CONFIG: portability fixes for HP-UX.
  503. +     DOC: several minor problems fixed in the Install & Op Guide.
  504. +     MAKEMAP: fix core dump problem on lines that are too long or
  505. +         which lack newline.  From Mark Delany.
  506. +     MAILSTATS: print sums of columns (total messages & kbytes
  507. +         in and out of the system).  From Tom Ferrin of UC
  508. +         San Francisco Computer Graphics Lab.
  509. +     SIGNIFICANT USER- OR SYSAD-VISIBLE CHANGES:
  510. +         On HP-UX, /etc/sendmail.cf has been moved to
  511. +             /usr/lib/sendmail.cf to match HP sendmail.
  512. +         Permissions have been tightened up on world-writable
  513. +             :include: files and accounts that have shells
  514. +             that are not listed in /etc/shells.  This may
  515. +             cause some .forward files that have worked
  516. +             before to start failing.
  517. +         SIGUSR1 dumps some state to the log.
  518. +     NEW FILES:
  519. +         src/Makefile.DGUX
  520. +         src/Makefile.Dynix
  521. +         src/Makefile.FreeBSD
  522. +         src/Makefile.Mach386
  523. +         src/Makefile.NetBSD
  524. +         src/Makefile.RISCos
  525. +         src/Makefile.SCO
  526. +         src/Makefile.SVR4
  527. +         src/Makefile.Titan
  528. +         cf/mailer/pop.m4
  529. +         cf/ostype/bsdi1.0.m4
  530. +         cf/ostype/dgux.m4
  531. +         cf/ostype/dynix3.2.m4
  532. +         cf/ostype/sco3.2.m4
  533. +         makemap/Makefile.dist
  534. +         praliases/Makefile.dist
  535.   8.6.4/8.6.4    93/10/31
  536.       Repair core-dump problem (write to read-only memory segment)
  537.           if you fall back to the return-to-Postmaster case in
  538. *** cf/README.OLD    Mon Nov  8 13:14:32 1993
  539. --- cf/README    Wed Jan 12 06:19:02 1994
  540. ***************
  541. *** 4,10 ****
  542.   
  543.           Eric Allman <eric@CS.Berkeley.EDU>
  544.   
  545. !         @(#)README    8.15 (Berkeley) 10/31/93
  546.   
  547.   
  548.   This document describes the sendmail configuration files being used
  549. --- 4,10 ----
  550.   
  551.           Eric Allman <eric@CS.Berkeley.EDU>
  552.   
  553. !         @(#)README    8.21 (Berkeley) 1/12/94
  554.   
  555.   
  556.   This document describes the sendmail configuration files being used
  557. ***************
  558. *** 31,40 ****
  559.   This package requires a post-V7 version of m4; if you are running the
  560.   4.2bsd, SysV.2, or 7th Edition version, I suggest finding a friend with
  561.   a newer version.  You can m4-expand on their system, then run locally.
  562. ! SunOS's /usr/5bin/m4 or BSD-Net/2's m4 both work.  GNU m4 (which is a
  563. ! language unto itself) also works, but I don't intend to work so hard
  564. ! to keep this up in the future.  [Note to GNU folks:  the construct
  565. ! "define(`FOO')" should work without my having to add a null value.]
  566.   
  567.   IF YOU DON'T HAVE A BERKELEY MAKE, don't despair!  Just run
  568.   "m4 foo.mc > foo.cf" -- that should be all you need.  There is also
  569. --- 31,39 ----
  570.   This package requires a post-V7 version of m4; if you are running the
  571.   4.2bsd, SysV.2, or 7th Edition version, I suggest finding a friend with
  572.   a newer version.  You can m4-expand on their system, then run locally.
  573. ! SunOS's /usr/5bin/m4 or BSD-Net/2's m4 both work.  GNU m4 version 1.1
  574. ! also works.  Unfortunately, I'm told that the M4 on BSDI 1.0 doesn't
  575. ! work -- you'll have to use a Net/2 or GNU version.
  576.   
  577.   IF YOU DON'T HAVE A BERKELEY MAKE, don't despair!  Just run
  578.   "m4 foo.mc > foo.cf" -- that should be all you need.  There is also
  579. ***************
  580. *** 52,58 ****
  581. --- 51,64 ----
  582.   configuration files can do; clever people can probably tweak them
  583.   to great effect.  But it should get you started.
  584.   
  585. + *******************************************************************
  586. + ***  BE SURE YOU CUSTOMIZE THESE FILES!  They have some        ***
  587. + ***  Berkeley-specific assumptions built in, such as the name    ***
  588. + ***  of our UUCP-relay.  You'll want to create your own domain    ***
  589. + ***  description, and use that in place of domain/Berkeley.m4.    ***
  590. + *******************************************************************
  591.   
  592.   +--------------------------+
  593.   | INTRODUCTION AND EXAMPLE |
  594.   +--------------------------+
  595. ***************
  596. *** 186,193 ****
  597.           connected.
  598.   BITNET_RELAY    The host that will forward BITNET-addressed email.
  599.           If not defined, the .BITNET pseudo-domain won't work.
  600. - CSNET_RELAY    The host that will forward CSNET-addressed email.
  601. -         If not defined, the .CSNET pseudo-domain won't work.
  602.   LOCAL_RELAY    The site that will handle unqualified names -- that
  603.           is, names with out an @domain extension.  If not set,
  604.           they are assumed to belong on this machine.  This
  605. --- 192,197 ----
  606. ***************
  607. *** 241,252 ****
  608.           is for when you know that the UUCP mailer at the other
  609.           end can handle multiple recipients in one transfer.
  610.           When you invoke this, sendmail looks for all names in
  611. !         the $=U class and sends them to the uucp mailer; all
  612. !         names in the $=Y class are sent to suucp.  Note that
  613.           this is a function of what version of rmail runs on
  614.           the receiving end, and hence may be out of your control.
  615. !         If smtp is defined, it also defines a "uucp-dom" mailer
  616. !         that uses domain-style rewriting.
  617.   
  618.   usenet        Usenet (network news) delivery.  If this is specified,
  619.           an extra rule is added to ruleset 0 that forwards all
  620. --- 245,259 ----
  621.           is for when you know that the UUCP mailer at the other
  622.           end can handle multiple recipients in one transfer.
  623.           When you invoke this, sendmail looks for all names in
  624. !         the $=U class and sends them to the uucp-old mailer; all
  625. !         names in the $=Y class are sent to uucp-new; and all
  626. !         names in the $=Z class are sent to uucp-uudom.  Note that
  627.           this is a function of what version of rmail runs on
  628.           the receiving end, and hence may be out of your control.
  629. !         If smtp is defined, it also defines "uucp-dom" and
  630. !         "uucp-uudom" mailers that use domain-style rewriting.
  631. !         See the section below describing UUCP mailers in more
  632. !         detail.
  633.   
  634.   usenet        Usenet (network news) delivery.  If this is specified,
  635.           an extra rule is added to ruleset 0 that forwards all
  636. ***************
  637. *** 258,264 ****
  638. --- 265,273 ----
  639.           on Sam Leffler's FlexFAX software.  For more information,
  640.           see below.
  641.   
  642. + pop        Post Office Protocol.
  643.   
  644.   +----------+
  645.   | FEATURES |
  646.   +----------+
  647. ***************
  648. *** 433,438 ****
  649. --- 442,533 ----
  650.   least in the same company).
  651.   
  652.   
  653. + +--------------------+
  654. + | USING UUCP MAILERS |
  655. + +--------------------+
  656. + It's hard to get UUCP mailers right because of the extremely ad hoc
  657. + nature of UUCP addressing.  These config files are really designed
  658. + for domain-based addressing, even for UUCP sites.
  659. + There are four UUCP mailers available.  The choice of which one to
  660. + use is partly a matter of local preferences and what is running at
  661. + the other end of your UUCP connection.  Unlike good protocols that
  662. + define what will go over the wire, UUCP uses the policy that you
  663. + should do what is right for the other end; if they change, you have
  664. + to change.  This makes it hard to do the right thing, and discourages
  665. + people from updating their software.  In general, if you can avoid
  666. + UUCP, please do.
  667. + The major choice is whether to go for a domainized scheme or a
  668. + non-domainized scheme.  This depends entirely on what the other
  669. + end will recognize.  If at all possible, you should encourage the
  670. + other end to go to a domain-based system -- non-domainized addresses
  671. + don't work entirely properly.
  672. + The four mailers are:
  673. +     uucp-old (obsolete name: "uucp")
  674. +     This is the oldest, the worst (but the closest to UUCP) way of
  675. +     sending messages accros UUCP connections.  It does bangify
  676. +     everything and prepends $U (your UUCP name) to the sender's
  677. +     address (which can already be a bang path itself).  It can
  678. +     only send to one address at a time, so it spends a lot of
  679. +     time copying duplicates of messages.  Avoid this if at all
  680. +     possible.
  681. +     uucp-new (obsolete name: "suucp")
  682. +     The same as above, except that it assumes that in one rmail
  683. +     command you can specify several recipients.  It still has a
  684. +     lot of other problems.
  685. +     uucp-dom
  686. +     This UUCP mailer keeps everything as domain addresses.
  687. +     Basically, it uses the SMTP mailer rewriting rules.
  688. +     Unfortunately, a lot of UUCP mailer transport agents require
  689. +     bangified addresses in the envelope, although you can use
  690. +     domain-based addresses in the message header.  (The envelope
  691. +     shows up as the From_ line on UNIX mail.)  So....
  692. +     uucp-uudom
  693. +     This is a cross between uucp-new (for the envelope addresses)
  694. +     and uucp-dom (for the header addresses).  It bangifies the
  695. +     envelope sender (From_ line in messages) without adding the
  696. +     local hostname, unless there is no host name on the address
  697. +     at all (e.g., "wolf") or the host component is a UUCP host name
  698. +     instead of a domain name ("somehost!wolf" instead of
  699. +     "some.dom.ain!wolf").
  700. + Examples:
  701. + We are on host grasp.insa-lyon.fr (UUCP host name "grasp").  The
  702. + following summarizes the sender rewriting for various mailers.
  703. + Mailer          sender        rewriting in the envelope
  704. + ------        ------        -------------------------
  705. + uucp-{old,new}    wolf        grasp!wolf
  706. + uucp-dom    wolf        wolf@grasp.insa-lyon.fr
  707. + uucp-uudom    wolf        grasp.insa-lyon.fr!wolf
  708. + uucp-{old,new}    wolf@fr.net    grasp!fr.net!wolf
  709. + uucp-dom    wolf@fr.net    wolf@fr.net
  710. + uucp-uudom    wolf@fr.net    fr.net!wolf
  711. + uucp-{old,new}    somehost!wolf    grasp!somehost!wolf
  712. + uucp-dom    somehost!wolf    somehost!wolf@grasp.insa-lyon.fr
  713. + uucp-uudom    somehost!wolf    grasp.insa-lyon.fr!somehost!wolf
  714. + If you are using one of the domainized UUCP mailers, you really want
  715. + to convert all UUCP addresses to domain format -- otherwise, it will
  716. + do it for you (and probably not the way you expected).  For example,
  717. + if you have the address foo!bar!baz (and you are not sending to foo),
  718. + the heuristics will add the @uucp.relay.name or @local.host.name to
  719. + this address.  However, if you map foo to foo.host.name first, it
  720. + will not add the local hostname.  You can do this using the uucpdomain
  721. + feature.
  722.   +-------------------+
  723.   | TWEAKING RULESETS |
  724.   +-------------------+
  725. ***************
  726. *** 826,832 ****
  727. --- 921,934 ----
  728.   the option is only included to provide back-compatibility.  These are
  729.   marked with "*".
  730.   
  731. + Remember that these options are M4 variables, and hence may need to
  732. + be quoted.  In particular, arguments with commas will usually have to
  733. + be ``double quoted, like this phrase'' to avoid having the comma
  734. + confuse things.  This is common for alias file definitions and for
  735. + the read timeout.
  736.   M4 Variable Name    Default        Mac/Opt    Description
  737. + ================    =======        =======    ===========
  738.   confMAILER_NAME        MAILER-DAEMON    Dn    The sender name used for
  739.                           internally generated
  740.                           outgoing messages.
  741. ***************
  742. *** 846,853 ****
  743.                           SMTP mail.
  744.   confBLANK_SUB        .        OB    Blank (space) substitution
  745.                           character.
  746. ! confCON_EXPENSIVE    False        Oc    Connect immediately to
  747. !                         mailers marked expensive?
  748.   confCHECKPOINT_INTERVAL    10        OC    Checkpoint queue files
  749.                           every N recipients.
  750.   confDELIVERY_MODE    background    Od    Default delivery mode.
  751. --- 948,955 ----
  752.                           SMTP mail.
  753.   confBLANK_SUB        .        OB    Blank (space) substitution
  754.                           character.
  755. ! confCON_EXPENSIVE    False        Oc    Avoid connecting immediately
  756. !                         to mailers marked expensive?
  757.   confCHECKPOINT_INTERVAL    10        OC    Checkpoint queue files
  758.                           every N recipients.
  759.   confDELIVERY_MODE    background    Od    Default delivery mode.
  760. ***************
  761. *** 1019,1026 ****
  762.   MAILERS
  763.   
  764.      0    local, prog    local and program mailers
  765. !    1    smtp        SMTP channel
  766. !    2    uucp        UNIX-to-UNIX Copy Program
  767.      3    netnews        Network News delivery
  768.      4    fax        Sam Leffler's FlexFAX software
  769.   
  770. --- 1121,1128 ----
  771.   MAILERS
  772.   
  773.      0    local, prog    local and program mailers
  774. !    1    [e]smtp, relay    SMTP channel
  775. !    2    uucp-*        UNIX-to-UNIX Copy Program
  776.      3    netnews        Network News delivery
  777.      4    fax        Sam Leffler's FlexFAX software
  778.   
  779. ***************
  780. *** 1029,1035 ****
  781.   
  782.      A
  783.      B    Bitnet Relay
  784. !    C    CSNET Relay
  785.      D    The local domain -- usually not needed
  786.      E
  787.      F    FAX Relay
  788. --- 1131,1137 ----
  789.   
  790.      A
  791.      B    Bitnet Relay
  792. !    C
  793.      D    The local domain -- usually not needed
  794.      E
  795.      F    FAX Relay
  796. *** cf/cf/Makefile.OLD    Wed Dec  1 11:54:48 1993
  797. --- cf/cf/Makefile    Wed Dec  1 11:55:31 1993
  798. ***************
  799. *** 1,4 ****
  800. ! #    @(#)Makefile    8.4 (Berkeley) 10/15/93
  801.   
  802.   M4=    m4
  803.   #M4=    /usr/src/usr.bin/m4/obj/m4
  804. --- 1,4 ----
  805. ! #    @(#)Makefile    8.5 (Berkeley) 12/1/93
  806.   
  807.   M4=    m4
  808.   #M4=    /usr/src/usr.bin/m4/obj/m4
  809. ***************
  810. *** 15,20 ****
  811. --- 15,21 ----
  812.   
  813.   ALL=    cs-hidden.cf cs-exposed.cf \
  814.       hpux-cs-exposed.cf hpux-cs-hidden.cf \
  815. +     riscos-cs-exposed.cf \
  816.       sunos3.5-cs-exposed.cf sunos3.5-cs-hidden.cf \
  817.       sunos4.1-cs-exposed.cf sunos4.1-cs-hidden.cf \
  818.       ultrix4.1-cs-exposed.cf ultrix4.1-cs-hidden.cf \
  819. *** cf/domain/Berkeley.m4.OLD    Tue Oct  5 13:28:20 1993
  820. --- cf/domain/Berkeley.m4    Mon Dec 20 10:49:11 1993
  821. ***************
  822. *** 33,42 ****
  823.   # SUCH DAMAGE.
  824.   #
  825.   divert(0)
  826. ! VERSIONID(`@(#)Berkeley.m4    8.3 (Berkeley) 10/5/93')
  827.   define(`UUCP_RELAY', `ucbvax.Berkeley.EDU')dnl
  828.   define(`BITNET_RELAY', `jade.Berkeley.EDU')dnl
  829. - define(`CSNET_RELAY', `Relay.CV.COM')dnl
  830.   define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward')dnl
  831.   define(`confCW_FILE', `-o /etc/sendmail.cw')dnl
  832.   FEATURE(redirect)dnl
  833. --- 33,41 ----
  834.   # SUCH DAMAGE.
  835.   #
  836.   divert(0)
  837. ! VERSIONID(`@(#)Berkeley.m4    8.4 (Berkeley) 12/20/93')
  838.   define(`UUCP_RELAY', `ucbvax.Berkeley.EDU')dnl
  839.   define(`BITNET_RELAY', `jade.Berkeley.EDU')dnl
  840.   define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward')dnl
  841.   define(`confCW_FILE', `-o /etc/sendmail.cw')dnl
  842.   FEATURE(redirect)dnl
  843. *** cf/feature/bitdomain.m4.OLD    Tue Nov 30 08:58:24 1993
  844. --- cf/feature/bitdomain.m4    Tue Nov 30 09:01:07 1993
  845. ***************
  846. *** 34,40 ****
  847.   #
  848.   
  849.   divert(0)
  850. ! VERSIONID(`@(#)bitdomain.m4    8.3 (Berkeley) 8/7/93')
  851.   divert(-1)
  852.   
  853.   
  854. --- 34,40 ----
  855.   #
  856.   
  857.   divert(0)
  858. ! VERSIONID(`@(#)bitdomain.m4    8.4 (Berkeley) 11/30/93')
  859.   divert(-1)
  860.   
  861.   
  862. ***************
  863. *** 45,49 ****
  864.   
  865.   PUSHDIVERT(8)
  866.   # handle BITNET mapping
  867. ! R$* < @ $+ .BITNET > $*        $: $1 < @ $(bitdomain $2 $: $2.BITNET $) > $3
  868.   POPDIVERT
  869. --- 45,49 ----
  870.   
  871.   PUSHDIVERT(8)
  872.   # handle BITNET mapping
  873. ! R$* < @ $+ .BITNET. > $*    $: $1 < @ $(bitdomain $2 $: $2.BITNET. $) > $3
  874.   POPDIVERT
  875. *** cf/feature/redirect.m4.OLD    Mon Jun  7 10:10:46 1993
  876. --- cf/feature/redirect.m4    Mon Dec 27 14:48:46 1993
  877. ***************
  878. *** 34,46 ****
  879.   #
  880.   
  881.   divert(0)
  882. ! VERSIONID(`@(#)redirect.m4    8.1 (Berkeley) 6/7/93')
  883.   divert(-1)
  884.   
  885.   
  886.   PUSHDIVERT(3)
  887.   # addresses sent to foo@host.REDIRECT will give a 551 error code
  888. ! R$* < @ $+ .REDIRECT >    $# error $@ NOUSER $: "551 User not local; please try " <$1@$2>
  889.   POPDIVERT
  890.   
  891.   PUSHDIVERT(6)
  892. --- 34,46 ----
  893.   #
  894.   
  895.   divert(0)
  896. ! VERSIONID(`@(#)redirect.m4    8.2 (Berkeley) 12/27/93')
  897.   divert(-1)
  898.   
  899.   
  900.   PUSHDIVERT(3)
  901.   # addresses sent to foo@host.REDIRECT will give a 551 error code
  902. ! R$* < @ $+ .REDIRECT. >    $# error $@ NOUSER $: "551 User not local; please try " <$1@$2>
  903.   POPDIVERT
  904.   
  905.   PUSHDIVERT(6)
  906. *** cf/feature/uucpdomain.m4.OLD    Tue Nov 30 07:18:13 1993
  907. --- cf/feature/uucpdomain.m4    Tue Nov 30 09:01:08 1993
  908. ***************
  909. *** 34,40 ****
  910.   #
  911.   
  912.   divert(0)
  913. ! VERSIONID(`@(#)uucpdomain.m4    8.3 (Berkeley) 8/7/93')
  914.   divert(-1)
  915.   
  916.   
  917. --- 34,40 ----
  918.   #
  919.   
  920.   divert(0)
  921. ! VERSIONID(`@(#)uucpdomain.m4    8.4 (Berkeley) 11/30/93')
  922.   divert(-1)
  923.   
  924.   
  925. ***************
  926. *** 45,49 ****
  927.   
  928.   PUSHDIVERT(8)
  929.   # handle UUCP mapping
  930. ! R$* < @ $+ .UUCP > $*        $: $1 < @ $(uudomain $2 $: $2.UUCP $) > $3
  931.   POPDIVERT
  932. --- 45,49 ----
  933.   
  934.   PUSHDIVERT(8)
  935.   # handle UUCP mapping
  936. ! R$* < @ $+ .UUCP. > $*        $: $1 < @ $(uudomain $2 $: $2.UUCP. $) > $3
  937.   POPDIVERT
  938. *** cf/m4/cf.m4.OLD    Sun Jul 18 10:58:54 1993
  939. --- cf/m4/cf.m4    Fri Dec 24 06:34:40 1993
  940. ***************
  941. *** 51,56 ****
  942. --- 51,57 ----
  943.   
  944.   changecom()
  945.   undefine(`format')
  946. + undefine(`hpux')
  947.   ifdef(`pushdef', `',
  948.       `errprint(`You need a newer version of M4, at least as new as
  949.   System V or GNU')
  950. ***************
  951. *** 92,98 ****
  952.   define(`SITECONFIG',
  953.   `CONCAT(D, $3, $2)
  954.   define(`_CLASS_$3_', `')dnl
  955. ! ifelse($3, U, Cw$2, `dnl')
  956.   define(`SITE', `ifelse(CONCAT($'2`, $3), SU,
  957.           CONCAT(CY, $'1`),
  958.           CONCAT(C, $3, $'1`))')
  959. --- 93,99 ----
  960.   define(`SITECONFIG',
  961.   `CONCAT(D, $3, $2)
  962.   define(`_CLASS_$3_', `')dnl
  963. ! ifelse($3, U, Cw$2 $2.UUCP, `dnl')
  964.   define(`SITE', `ifelse(CONCAT($'2`, $3), SU,
  965.           CONCAT(CY, $'1`),
  966.           CONCAT(C, $3, $'1`))')
  967. ***************
  968. *** 145,148 ****
  969.   define(`confTRY_NULL_MX_LIST', `False')
  970.   
  971.   divert(0)dnl
  972. ! VERSIONID(`@(#)cf.m4    8.2 (Berkeley) 7/18/93')
  973. --- 146,149 ----
  974.   define(`confTRY_NULL_MX_LIST', `False')
  975.   
  976.   divert(0)dnl
  977. ! VERSIONID(`@(#)cf.m4    8.4 (Berkeley) 12/24/93')
  978. *** cf/m4/proto.m4.OLD    Tue Nov 23 09:55:51 1993
  979. --- cf/m4/proto.m4    Thu Jan 13 06:40:24 1994
  980. ***************
  981. *** 34,40 ****
  982.   #
  983.   divert(0)
  984.   
  985. ! VERSIONID(`@(#)proto.m4    8.20 (Berkeley) 10/31/93')
  986.   
  987.   MAILER(local)dnl
  988.   
  989. --- 34,40 ----
  990.   #
  991.   divert(0)
  992.   
  993. ! VERSIONID(`@(#)proto.m4    8.30 (Berkeley) 1/12/94')
  994.   
  995.   MAILER(local)dnl
  996.   
  997. ***************
  998. *** 93,104 ****
  999.   CPBITNET
  1000.   
  1001.   ')dnl
  1002. - ifdef(`CSNET_RELAY',
  1003. - `# CSNET relay host
  1004. - DC`'CSNET_RELAY
  1005. - CPCSNET
  1006. - ')dnl
  1007.   ifdef(`FAX_RELAY',
  1008.   `# FAX relay host
  1009.   DF`'FAX_RELAY
  1010. --- 93,98 ----
  1011. ***************
  1012. *** 185,191 ****
  1013.   # substitution for space (blank) characters
  1014.   OB`'confBLANK_SUB
  1015.   
  1016. ! # connect to "expensive" mailers on initial submission?
  1017.   Oc`'confCON_EXPENSIVE
  1018.   
  1019.   # checkpoint queue runs after every N successful deliveries
  1020. --- 179,185 ----
  1021.   # substitution for space (blank) characters
  1022.   OB`'confBLANK_SUB
  1023.   
  1024. ! # avoid connecting to "expensive" mailers on initial submission?
  1025.   Oc`'confCON_EXPENSIVE
  1026.   
  1027.   # checkpoint queue runs after every N successful deliveries
  1028. ***************
  1029. *** 420,425 ****
  1030. --- 414,422 ----
  1031.   R$+ < $+ @ $+ >        $1 $2 < @ $3 >            move gaze right
  1032.   R$+ < @ $+ >        $@ $>_SET_96_ $1 < @ $2 >        already canonical
  1033.   
  1034. + # do some sanity checking
  1035. + R$* < @ $* : $* > $*    $1 < @ $2 $3 > $4        nix colons in addrs
  1036.   ifdef(`_NO_UUCP_', `dnl',
  1037.   `# convert old-style addresses to a domain-based address
  1038.   R$- ! $+        $@ $>_SET_96_ $2 < @ $1 .UUCP >    resolve uucp names
  1039. ***************
  1040. *** 458,488 ****
  1041.   ifdef(`_NO_UUCP_', `dnl',
  1042.   `ifdef(`UUCP_RELAY',
  1043.   `# pass UUCP addresses straight through
  1044. ! R$* < @ $+ . UUCP > $*        $@ $1 < @ $2 . UUCP > $3',
  1045.   `# if really UUCP, handle it immediately
  1046.   ifdef(`_CLASS_U_',
  1047. ! `R$* < @ $=U . UUCP > $*    $@ $1 < @ $2 . UUCP > $3', `dnl')
  1048.   ifdef(`_CLASS_V_',
  1049. ! `R$* < @ $=V . UUCP > $*    $@ $1 < @ $2 . UUCP > $3', `dnl')
  1050.   ifdef(`_CLASS_W_',
  1051. ! `R$* < @ $=W . UUCP > $*    $@ $1 < @ $2 . UUCP > $3', `dnl')
  1052.   ifdef(`_CLASS_X_',
  1053. ! `R$* < @ $=X . UUCP > $*    $@ $1 < @ $2 . UUCP > $3', `dnl')
  1054.   ifdef(`_CLASS_Y_',
  1055. ! `R$* < @ $=Y . UUCP > $*    $@ $1 < @ $2 . UUCP > $3', `dnl')
  1056.   
  1057.   # try UUCP traffic as a local address
  1058. ! R$* < @ $+ . UUCP > $*        $: $1 < @ $[ $2 $] . UUCP > $3
  1059.   ifdef(`_OLD_SENDMAIL_',
  1060. ! `R$* < @ $+ . $+ . UUCP > $*        $@ $1 < @ $2 . $3 . > $4',
  1061. ! `R$* < @ $+ . . UUCP > $*        $@ $1 < @ $2 . > $3')')
  1062.   ')
  1063. ! ifdef(`_NO_CANONIFY_',
  1064. ! `# make sure local host names appear canonical
  1065. ! R$* < @ $=w > $*        $: $1 < @ $2 . > $3',
  1066.   `# pass to name server to make hostname canonical
  1067.   R$* < @ $* $~P > $*        $: $1 < @ $[ $2 $3 $] > $4')
  1068.   
  1069.   undivert(8)dnl
  1070.   
  1071.   # if this is the local hostname, make sure we treat is as canonical
  1072. --- 455,488 ----
  1073.   ifdef(`_NO_UUCP_', `dnl',
  1074.   `ifdef(`UUCP_RELAY',
  1075.   `# pass UUCP addresses straight through
  1076. ! R$* < @ $+ . UUCP > $*        $@ $1 < @ $2 . UUCP . > $3',
  1077.   `# if really UUCP, handle it immediately
  1078.   ifdef(`_CLASS_U_',
  1079. ! `R$* < @ $=U . UUCP > $*    $@ $1 < @ $2 . UUCP . > $3', `dnl')
  1080.   ifdef(`_CLASS_V_',
  1081. ! `R$* < @ $=V . UUCP > $*    $@ $1 < @ $2 . UUCP . > $3', `dnl')
  1082.   ifdef(`_CLASS_W_',
  1083. ! `R$* < @ $=W . UUCP > $*    $@ $1 < @ $2 . UUCP . > $3', `dnl')
  1084.   ifdef(`_CLASS_X_',
  1085. ! `R$* < @ $=X . UUCP > $*    $@ $1 < @ $2 . UUCP . > $3', `dnl')
  1086.   ifdef(`_CLASS_Y_',
  1087. ! `R$* < @ $=Y . UUCP > $*    $@ $1 < @ $2 . UUCP . > $3', `dnl')
  1088.   
  1089.   # try UUCP traffic as a local address
  1090. ! R$* < @ $+ . UUCP > $*        $: $1 < @ $[ $2 $] . UUCP . > $3
  1091.   ifdef(`_OLD_SENDMAIL_',
  1092. ! `R$* < @ $+ . $+ . UUCP . > $*        $@ $1 < @ $2 . $3 . > $4',
  1093. ! `R$* < @ $+ . . UUCP . > $*        $@ $1 < @ $2 . > $3')')
  1094.   ')
  1095. ! ifdef(`_NO_CANONIFY_', `dnl',
  1096.   `# pass to name server to make hostname canonical
  1097.   R$* < @ $* $~P > $*        $: $1 < @ $[ $2 $3 $] > $4')
  1098.   
  1099. + # local host aliases and pseudo-domains are always canonical
  1100. + R$* < @ $=w > $*        $: $1 < @ $2 . > $3
  1101. + R$* < @ $* $=P > $*        $: $1 < @ $2 $3 . > $4
  1102. + R$* < @ $* . . > $*        $1 < @ $2 . > $3
  1103.   undivert(8)dnl
  1104.   
  1105.   # if this is the local hostname, make sure we treat is as canonical
  1106. ***************
  1107. *** 534,539 ****
  1108. --- 534,540 ----
  1109.   
  1110.   R<@>            $#_LOCAL_ $: <>            special case error msgs
  1111.   R$*:;<@>        $#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
  1112. + R<@ $+>            $#error $@ USAGE $: "user address required"
  1113.   
  1114.   ifdef(`_MAILER_smtp_',
  1115.   `# handle numeric address spec
  1116. ***************
  1117. *** 540,546 ****
  1118.   ifdef(`_NO_CANONIFY_', `dnl',
  1119.   `R$* < @ [ $+ ] > $*    $: $1 < @ $[ [$2] $] > $3    numeric internet addr')
  1120.   R$* < @ [ $+ ] > $*    $: $>_SET_98_ $1 < @ [ $2 ] > $3    numeric internet spec
  1121. ! R$* < @ [ $+ ] > $*    $#_SMTP_ $@ [$2] $: $1 @ [$2] $3    still numeric: send',
  1122.       `dnl')
  1123.   
  1124.   # now delete the local info -- note $=O to find characters that cause forwarding
  1125. --- 541,547 ----
  1126.   ifdef(`_NO_CANONIFY_', `dnl',
  1127.   `R$* < @ [ $+ ] > $*    $: $1 < @ $[ [$2] $] > $3    numeric internet addr')
  1128.   R$* < @ [ $+ ] > $*    $: $>_SET_98_ $1 < @ [ $2 ] > $3    numeric internet spec
  1129. ! R$* < @ [ $+ ] > $*    $#_SMTP_ $@ [$2] $: $1 < @ [$2] > $3    still numeric: send',
  1130.       `dnl')
  1131.   
  1132.   # now delete the local info -- note $=O to find characters that cause forwarding
  1133. ***************
  1134. *** 564,570 ****
  1135.   ifdef(`_LOCAL_NOT_STICKY_',
  1136.   `R$=L < @ $=w . >        $#_LOCAL_ $: @ $1            special local names
  1137.   R$+ < @ $=w . >        $#_LOCAL_ $: $1            dispose directly',
  1138. ! `R$+ < @ $=w . >        $: $1 < @ $2 @ $H >        first try hub
  1139.   ifdef(`_OLD_SENDMAIL_',
  1140.   `R$+ < $+ @ $-:$+ >    $# $3 $@ $4 $: $1 < $2 >    yep ....
  1141.   R$+ < $+ @ $+ >        $#relay $@ $3 $: $1 < $2 >    yep ....
  1142. --- 565,571 ----
  1143.   ifdef(`_LOCAL_NOT_STICKY_',
  1144.   `R$=L < @ $=w . >        $#_LOCAL_ $: @ $1            special local names
  1145.   R$+ < @ $=w . >        $#_LOCAL_ $: $1            dispose directly',
  1146. ! `R$+ < @ $=w . >        $: $1 < @ $2 . @ $H >        first try hub
  1147.   ifdef(`_OLD_SENDMAIL_',
  1148.   `R$+ < $+ @ $-:$+ >    $# $3 $@ $4 $: $1 < $2 >    yep ....
  1149.   R$+ < $+ @ $+ >        $#relay $@ $3 $: $1 < $2 >    yep ....
  1150. ***************
  1151. *** 576,614 ****
  1152.   ifdef(`_NO_UUCP_', `dnl',
  1153.   `# resolve remotely connected UUCP links (if any)
  1154.   ifdef(`_CLASS_V_',
  1155. ! `R$* < @ $=V . UUCP > $*        $: $>_SET_95_ < $V > $1 <@$2.UUCP> $3',
  1156.       `dnl')
  1157.   ifdef(`_CLASS_W_',
  1158. ! `R$* < @ $=W . UUCP > $*        $: $>_SET_95_ < $W > $1 <@$2.UUCP> $3',
  1159.       `dnl')
  1160.   ifdef(`_CLASS_X_',
  1161. ! `R$* < @ $=X . UUCP > $*        $: $>_SET_95_ < $X > $1 <@$2.UUCP> $3',
  1162.       `dnl')')
  1163.   
  1164.   # resolve fake top level domains by forwarding to other hosts
  1165.   ifdef(`BITNET_RELAY',
  1166. ! `R$*<@$+.BITNET>$*    $: $>_SET_95_ < $B > $1 <@$2.BITNET> $3    user@host.BITNET',
  1167.       `dnl')
  1168. ! ifdef(`CSNET_RELAY',
  1169. ! `R$*<@$+.CSNET>$*    $: $>_SET_95_ < $C > $1 <@$2.CSNET> $3    user@host.CSNET',
  1170.       `dnl')
  1171.   ifdef(`_MAILER_fax_',
  1172. ! `R$+ < @ $+ .FAX >    $#fax $@ $2 $: $1        user@host.FAX',
  1173.   `ifdef(`FAX_RELAY',
  1174. ! `R$*<@$+.FAX>$*        $: $>_SET_95_ < $F > $1 <@$2.FAX> $3    user@host.FAX',
  1175.       `dnl')')
  1176.   
  1177.   ifdef(`UUCP_RELAY',
  1178.   `# forward non-local UUCP traffic to our UUCP relay
  1179. ! R$*<@$*.UUCP>$*        $: $>_SET_95_ < $Y > $1 @ <$2.UUCP> $3    uucp mail',
  1180.   `ifdef(`_MAILER_uucp_',
  1181.   `# forward other UUCP traffic straight to UUCP
  1182. ! R< @ $+ .UUCP > : $+    $#uucp $@ $1 $: $2        @host.UUCP:...
  1183. ! R$+ < @ $+ .UUCP >    $#uucp $@ $2 $: $1        user@host.UUCP',
  1184.       `dnl')')
  1185.   ifdef(`_MAILER_usenet_', `
  1186.   # addresses sent to net.group.USENET will get forwarded to a newsgroup
  1187. ! R$+ . USENET        $#usenet $: $1',
  1188.       `dnl')
  1189.   
  1190.   ifdef(`_LOCAL_RULES_',
  1191. --- 577,614 ----
  1192.   ifdef(`_NO_UUCP_', `dnl',
  1193.   `# resolve remotely connected UUCP links (if any)
  1194.   ifdef(`_CLASS_V_',
  1195. ! `R$* < @ $=V . UUCP . > $*        $: $>_SET_95_ < $V > $1 <@$2.UUCP.> $3',
  1196.       `dnl')
  1197.   ifdef(`_CLASS_W_',
  1198. ! `R$* < @ $=W . UUCP . > $*        $: $>_SET_95_ < $W > $1 <@$2.UUCP.> $3',
  1199.       `dnl')
  1200.   ifdef(`_CLASS_X_',
  1201. ! `R$* < @ $=X . UUCP . > $*        $: $>_SET_95_ < $X > $1 <@$2.UUCP.> $3',
  1202.       `dnl')')
  1203.   
  1204.   # resolve fake top level domains by forwarding to other hosts
  1205.   ifdef(`BITNET_RELAY',
  1206. ! `R$*<@$+.BITNET.>$*    $: $>_SET_95_ < $B > $1 <@$2.BITNET.> $3    user@host.BITNET',
  1207.       `dnl')
  1208. ! ifdef(`_MAILER_pop_',
  1209. ! `R$+ < @ POP. >        $#pop $: $1            user@POP',
  1210.       `dnl')
  1211.   ifdef(`_MAILER_fax_',
  1212. ! `R$+ < @ $+ .FAX. >    $#fax $@ $2 $: $1        user@host.FAX',
  1213.   `ifdef(`FAX_RELAY',
  1214. ! `R$*<@$+.FAX.>$*        $: $>_SET_95_ < $F > $1 <@$2.FAX.> $3    user@host.FAX',
  1215.       `dnl')')
  1216.   
  1217.   ifdef(`UUCP_RELAY',
  1218.   `# forward non-local UUCP traffic to our UUCP relay
  1219. ! R$*<@$*.UUCP.>$*        $: $>_SET_95_ < $Y > $1 <@$2.UUCP.> $3    uucp mail',
  1220.   `ifdef(`_MAILER_uucp_',
  1221.   `# forward other UUCP traffic straight to UUCP
  1222. ! R$* < @ $+ .UUCP. > $*        $#uucp $@ $2 $: $1 < @ $2 .UUCP. > $3    user@host.UUCP',
  1223.       `dnl')')
  1224.   ifdef(`_MAILER_usenet_', `
  1225.   # addresses sent to net.group.USENET will get forwarded to a newsgroup
  1226. ! R$+ . USENET.        $#usenet $: $1',
  1227.       `dnl')
  1228.   
  1229.   ifdef(`_LOCAL_RULES_',
  1230. *** cf/m4/version.m4.OLD    Tue Nov 30 08:59:13 1993
  1231. --- cf/m4/version.m4    Thu Jan 13 06:42:08 1994
  1232. ***************
  1233. *** 32,39 ****
  1234.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1235.   # SUCH DAMAGE.
  1236.   #
  1237. ! VERSIONID(`@(#)version.m4    8.6.1.4 (Berkeley) 10/31/93')
  1238.   #
  1239.   divert(0)
  1240.   # Configuration version number
  1241. ! DZ8.6.4
  1242. --- 32,39 ----
  1243.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1244.   # SUCH DAMAGE.
  1245.   #
  1246. ! VERSIONID(`@(#)version.m4    8.6.1.5 (Berkeley) 1/13/94')
  1247.   #
  1248.   divert(0)
  1249.   # Configuration version number
  1250. ! DZ8.6.5
  1251. *** cf/mailer/pop.m4.OLD    Tue Dec 14 14:29:44 1993
  1252. --- cf/mailer/pop.m4    Wed Dec 15 06:36:42 1993
  1253. ***************
  1254. *** 0 ****
  1255. --- 1,54 ----
  1256. + PUSHDIVERT(-1)
  1257. + #
  1258. + # Copyright (c) 1983 Eric P. Allman
  1259. + # Copyright (c) 1988, 1993
  1260. + #    The Regents of the University of California.  All rights reserved.
  1261. + #
  1262. + # Redistribution and use in source and binary forms, with or without
  1263. + # modification, are permitted provided that the following conditions
  1264. + # are met:
  1265. + # 1. Redistributions of source code must retain the above copyright
  1266. + #    notice, this list of conditions and the following disclaimer.
  1267. + # 2. Redistributions in binary form must reproduce the above copyright
  1268. + #    notice, this list of conditions and the following disclaimer in the
  1269. + #    documentation and/or other materials provided with the distribution.
  1270. + # 3. All advertising materials mentioning features or use of this software
  1271. + #    must display the following acknowledgement:
  1272. + #    This product includes software developed by the University of
  1273. + #    California, Berkeley and its contributors.
  1274. + # 4. Neither the name of the University nor the names of its contributors
  1275. + #    may be used to endorse or promote products derived from this software
  1276. + #    without specific prior written permission.
  1277. + #
  1278. + # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1279. + # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1280. + # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1281. + # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1282. + # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1283. + # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1284. + # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1285. + # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1286. + # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1287. + # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1288. + # SUCH DAMAGE.
  1289. + #
  1290. + ifdef(`POP_MAILER_PATH',, `define(`POP_MAILER_PATH', /usr/lib/mh/spop)')
  1291. + ifdef(`POP_MAILER_FLAGS',, `define(`POP_MAILER_FLAGS', `eu')')
  1292. + ifdef(`POP_MAILER_ARGS',, `define(`POP_MAILER_ARGS', `pop $u')')
  1293. + POPDIVERT
  1294. + LOCAL_CONFIG
  1295. + # POP mailer is a pseudo-domain
  1296. + CPPOP
  1297. + POPDIVERT
  1298. + ####################################
  1299. + ###   POP Mailer specification   ###
  1300. + ####################################
  1301. + VERSIONID(`@(#)pop.m4    8.1 (Berkeley) 12/15/93')
  1302. + Mpop,        P=POP_MAILER_PATH, F=CONCAT(`lsDFM', POP_MAILER_FLAGS), S=10, R=20/40,
  1303. +         A=POP_MAILER_ARGS
  1304. *** cf/mailer/smtp.m4.OLD    Wed Nov 10 07:02:30 1993
  1305. --- cf/mailer/smtp.m4    Mon Dec 27 14:49:22 1993
  1306. ***************
  1307. *** 40,52 ****
  1308.   ###   SMTP Mailer specification   ###
  1309.   #####################################
  1310.   
  1311. ! VERSIONID(`@(#)smtp.m4    8.7 (Berkeley) 10/31/93')
  1312.   
  1313.   Msmtp,        P=[IPC], F=CONCAT(mDFMuX, SMTP_MAILER_FLAGS), S=11/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), E=\r\n,
  1314.           ifdef(`_OLD_SENDMAIL_',, `L=990, ')A=IPC $h
  1315.   Mesmtp,        P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS), S=11/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), E=\r\n,
  1316.           ifdef(`_OLD_SENDMAIL_',, `L=990, ')A=IPC $h
  1317. ! Mrelay,        P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS), S=11/31, R=51, E=\r\n,
  1318.           ifdef(`_OLD_SENDMAIL_',, `L=2040, ')A=IPC $h
  1319.   
  1320.   #
  1321. --- 40,52 ----
  1322.   ###   SMTP Mailer specification   ###
  1323.   #####################################
  1324.   
  1325. ! VERSIONID(`@(#)smtp.m4    8.13 (Berkeley) 12/27/93')
  1326.   
  1327.   Msmtp,        P=[IPC], F=CONCAT(mDFMuX, SMTP_MAILER_FLAGS), S=11/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), E=\r\n,
  1328.           ifdef(`_OLD_SENDMAIL_',, `L=990, ')A=IPC $h
  1329.   Mesmtp,        P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS), S=11/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), E=\r\n,
  1330.           ifdef(`_OLD_SENDMAIL_',, `L=990, ')A=IPC $h
  1331. ! Mrelay,        P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS), S=11/31, R=61, E=\r\n,
  1332.           ifdef(`_OLD_SENDMAIL_',, `L=2040, ')A=IPC $h
  1333.   
  1334.   #
  1335. ***************
  1336. *** 55,66 ****
  1337.   S11
  1338.   R$+            $: $>51 $1            sender/recipient common
  1339.   R$* :; <@>        $@ $1 :;            list:; special case
  1340.   
  1341. - # handle unqualified names
  1342. - R$* < @ $* > $*        $@ $1 < @ $2 > $3        already qualified
  1343. - R$*            $@ $>61 $1
  1344.   
  1345.   #
  1346.   #  header recipient rewriting if not masquerading recipients
  1347.   #
  1348. --- 55,63 ----
  1349.   S11
  1350.   R$+            $: $>51 $1            sender/recipient common
  1351.   R$* :; <@>        $@ $1 :;            list:; special case
  1352. + R$*            $@ $>61 $1            qualify unqual'ed names
  1353.   
  1354.   
  1355.   #
  1356.   #  header recipient rewriting if not masquerading recipients
  1357.   #
  1358. ***************
  1359. *** 87,100 ****
  1360.   R$=E < @ $=w . >    $@ $1 < @ $2 >            exposed user as is
  1361.   R$* < @ $=w . >        $: $1 < @ $M >            masquerade as domain
  1362.   R$* < @ >        $: $1 < @ $j >            in case $M undefined
  1363.   
  1364. - # handle unqualified names
  1365. - R$* < @ $* > $*        $@ $1 < @ $2 > $3        already qualified
  1366. - R$*            $@ $>61 $1
  1367.   
  1368.   #
  1369. ! #  common rewriting for all SMTP addresses
  1370.   #
  1371.   S51
  1372.   
  1373. --- 84,94 ----
  1374.   R$=E < @ $=w . >    $@ $1 < @ $2 >            exposed user as is
  1375.   R$* < @ $=w . >        $: $1 < @ $M >            masquerade as domain
  1376.   R$* < @ >        $: $1 < @ $j >            in case $M undefined
  1377. + R$*            $@ $>61 $1            qualify unqual'ed names
  1378.   
  1379.   
  1380.   #
  1381. ! #  convert pseudo-domain addresses to real domain addresses
  1382.   #
  1383.   S51
  1384.   
  1385. ***************
  1386. *** 103,124 ****
  1387.   
  1388.   # output fake domains as user%fake@relay
  1389.   ifdef(`BITNET_RELAY',
  1390. ! `R$+ <@ $+ . BITNET >    $: $1 % $2 .BITNET < @ $B >    user@host.BITNET
  1391.   R$+.BITNET <@ $+:$+ >    $: $1 .BITNET < @ $3 >        strip mailer: part',
  1392.       `dnl')
  1393. ! ifdef(`CSNET_RELAY',
  1394. ! `R$+ <@ $+ . CSNET >    $: $1 % $2 .CSNET < @ $C >    user@host.CSNET
  1395. ! R$+.CSNET <@ $+:$+ >    $: $1 .CSNET < @ $3 >        strip mailer: part',
  1396. !     `dnl')
  1397. ! ifdef(`_NO_UUCP_', `dnl',
  1398. ! `R$+ <@ $+ . UUCP >    $: $2 ! $1 < @ $j >        user@host.UUCP')
  1399.   
  1400.   
  1401.   #
  1402.   #  common sender and masquerading recipient rewriting
  1403.   #
  1404.   S61
  1405.   
  1406.   R$=E            $@ $1 < @ $j>            show exposed names
  1407.   R$+            $: $1 < @ $M >            user w/o host
  1408.   R$+ <@>            $: $1 < @ $j >            in case $M undefined
  1409. --- 97,125 ----
  1410.   
  1411.   # output fake domains as user%fake@relay
  1412.   ifdef(`BITNET_RELAY',
  1413. ! `R$+ <@ $+ .BITNET. >    $: $1 % $2 .BITNET < @ $B >    user@host.BITNET
  1414.   R$+.BITNET <@ $+:$+ >    $: $1 .BITNET < @ $3 >        strip mailer: part',
  1415.       `dnl')
  1416. ! ifdef(`_NO_UUCP_', `dnl', `
  1417. ! # do UUCP heuristics; note that these are shared with UUCP mailers
  1418. ! R$+ < @ $+ .UUCP. >    $: < $2 ! > $1            convert to UUCP form
  1419. ! R$+ < @ $* > $*        $@ $1 < @ $2 > $3        not UUCP form
  1420.   
  1421. + # leave these in .UUCP form to avoid further tampering
  1422. + R< $&h ! > $- ! $+    $@ $2 < @ $1 .UUCP. >
  1423. + R< $&h ! > $-.$+ ! $+    $@ $3 < @ $1.$2 >
  1424. + R< $&h ! > $+        $@ $1 < @ $&h .UUCP. >
  1425. + R< $+ ! > $+        $: $1 ! $2 < @ $Y >
  1426. + R$+ < @ >        $: $1 < @ $j >            in case $Y undefined
  1427. + R$+ < @ $+ : $+ >    $: $1 < @ $3 >            strip mailer: part')
  1428.   
  1429.   #
  1430.   #  common sender and masquerading recipient rewriting
  1431.   #
  1432.   S61
  1433.   
  1434. + R$* < @ $* > $*        $@ $1 < @ $2 > $3        already qualified
  1435.   R$=E            $@ $1 < @ $j>            show exposed names
  1436.   R$+            $: $1 < @ $M >            user w/o host
  1437.   R$+ <@>            $: $1 < @ $j >            in case $M undefined
  1438. *** cf/mailer/uucp.m4.OLD    Thu Nov 11 06:21:23 1993
  1439. --- cf/mailer/uucp.m4    Mon Jan 10 08:01:11 1994
  1440. ***************
  1441. *** 42,60 ****
  1442.   ###   UUCP Mailer specification   ###
  1443.   #####################################
  1444.   
  1445. ! VERSIONID(`@(#)uucp.m4    8.6 (Berkeley) 10/31/93')
  1446.   
  1447. ! # old UUCP mailer
  1448.   Muucp,        P=UUCP_MAILER_PATH, F=CONCAT(DFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
  1449.           A=UUCP_MAILER_ARGS
  1450.   
  1451. ! # smart UUCP mailer (handles multiple addresses)
  1452.   Msuucp,        P=UUCP_MAILER_PATH, F=CONCAT(mDFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
  1453.           A=UUCP_MAILER_ARGS
  1454.   
  1455.   ifdef(`_MAILER_smtp_',
  1456.   `# domain-ized UUCP mailer
  1457.   Muucp-dom,    P=UUCP_MAILER_PATH, F=CONCAT(mDFMhu, UUCP_MAILER_FLAGS), S=52/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), M=UUCP_MAX_SIZE,
  1458.           A=UUCP_MAILER_ARGS')
  1459.   
  1460.   
  1461. --- 42,73 ----
  1462.   ###   UUCP Mailer specification   ###
  1463.   #####################################
  1464.   
  1465. ! VERSIONID(`@(#)uucp.m4    8.13 (Berkeley) 1/10/94')
  1466.   
  1467. ! #
  1468. ! #  There are innumerable variations on the UUCP mailer.  It really
  1469. ! #  is rather absurd.
  1470. ! #
  1471. ! # old UUCP mailer (two names)
  1472.   Muucp,        P=UUCP_MAILER_PATH, F=CONCAT(DFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
  1473.           A=UUCP_MAILER_ARGS
  1474. + Muucp-old,    P=UUCP_MAILER_PATH, F=CONCAT(DFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
  1475. +         A=UUCP_MAILER_ARGS
  1476.   
  1477. ! # smart UUCP mailer (handles multiple addresses) (two names)
  1478.   Msuucp,        P=UUCP_MAILER_PATH, F=CONCAT(mDFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
  1479.           A=UUCP_MAILER_ARGS
  1480. + Muucp-new,    P=UUCP_MAILER_PATH, F=CONCAT(mDFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
  1481. +         A=UUCP_MAILER_ARGS
  1482.   
  1483.   ifdef(`_MAILER_smtp_',
  1484.   `# domain-ized UUCP mailer
  1485.   Muucp-dom,    P=UUCP_MAILER_PATH, F=CONCAT(mDFMhu, UUCP_MAILER_FLAGS), S=52/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), M=UUCP_MAX_SIZE,
  1486. +         A=UUCP_MAILER_ARGS
  1487. + # domain-ized UUCP mailer with UUCP-style sender envelope
  1488. + Muucp-uudom,    P=UUCP_MAILER_PATH, F=CONCAT(mDFMhu, UUCP_MAILER_FLAGS), S=72/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), M=UUCP_MAX_SIZE,
  1489.           A=UUCP_MAILER_ARGS')
  1490.   
  1491.   
  1492. ***************
  1493. *** 70,79 ****
  1494.   R$* :; <@>            $@ $1 :;
  1495.   
  1496.   R$* < @ $* . >            $1 < @ $2 >        strip trailing dots
  1497. ! R$* < @ $j >            $1            strip local name
  1498.   R$* < @ $- . UUCP >        $2 ! $1            convert to UUCP format
  1499.   R$* < @ $+ >            $2 ! $1            convert to UUCP format
  1500.   R$+                $: $U ! $1        prepend our name
  1501.   
  1502.   #
  1503.   #  envelope and header recipient rewriting
  1504. --- 83,97 ----
  1505.   R$* :; <@>            $@ $1 :;
  1506.   
  1507.   R$* < @ $* . >            $1 < @ $2 >        strip trailing dots
  1508. ! R$* < @ $=w >            $1            strip local name
  1509. ! R<@ $- . UUCP > : $+        $1 ! $2            convert to UUCP format
  1510. ! R<@ $+ > : $+            $1 ! $2            convert to UUCP format
  1511.   R$* < @ $- . UUCP >        $2 ! $1            convert to UUCP format
  1512.   R$* < @ $+ >            $2 ! $1            convert to UUCP format
  1513. + R$&h ! $+ ! $+            $@ $1 ! $2        $h!...!user => ...!user
  1514. + R$&h ! $+            $@ $&h ! $1        $h!user => $h!user
  1515.   R$+                $: $U ! $1        prepend our name
  1516. + R! $+                $: $k ! $1        in case $U undefined
  1517.   
  1518.   #
  1519.   #  envelope and header recipient rewriting
  1520. ***************
  1521. *** 81,95 ****
  1522.   S22
  1523.   
  1524.   # don't touch list:; syntax
  1525. ! R$* :; <@>            $@ $1 ;:
  1526.   
  1527.   R$* < @ $* . >            $1 < @ $2 >        strip trailing dots
  1528.   R$* < @ $j >            $1            strip local name
  1529.   R$* < @ $- . UUCP >        $2 ! $1            convert to UUCP format
  1530.   R$* < @ $+ >            $2 ! $1            convert to UUCP format
  1531.   
  1532.   
  1533. ! #
  1534.   #  envelope sender rewriting for uucp-dom mailer
  1535.   #
  1536.   S52
  1537. --- 99,120 ----
  1538.   S22
  1539.   
  1540.   # don't touch list:; syntax
  1541. ! R$* :; <@>            $@ $1 :;
  1542.   
  1543.   R$* < @ $* . >            $1 < @ $2 >        strip trailing dots
  1544.   R$* < @ $j >            $1            strip local name
  1545. + R<@ $- . UUCP > : $+        $1 ! $2            convert to UUCP format
  1546. + R<@ $+ > : $+            $1 ! $2            convert to UUCP format
  1547.   R$* < @ $- . UUCP >        $2 ! $1            convert to UUCP format
  1548.   R$* < @ $+ >            $2 ! $1            convert to UUCP format
  1549. + R$&h ! $+ ! $+            $@ $1 ! $2        $h!...!user => ...!user
  1550. + R$&h ! $+            $@ $&h ! $1        $h!user => $h!user
  1551. + R$+                $: $U ! $1        prepend our name
  1552. + R! $+                $: $k ! $1        in case $U undefined
  1553.   
  1554.   
  1555. ! ifdef(`_MAILER_smtp_',
  1556. ! `#
  1557.   #  envelope sender rewriting for uucp-dom mailer
  1558.   #
  1559.   S52
  1560. ***************
  1561. *** 100,112 ****
  1562.   # pass everything to standard SMTP mailer rewriting
  1563.   R$*                $@ $>11 $1
  1564.   
  1565.   
  1566.   PUSHDIVERT(4)
  1567.   # resolve locally connected UUCP links
  1568. ! R< @ $=Z . UUCP > : $+        $#uucp-dom $@ $1 $: $2    @host.UUCP: ...
  1569. ! R$+ < @ $=Z . UUCP >        $#uucp-dom $@ $2 $: $1    user@host.UUCP
  1570. ! R< @ $=Y . UUCP > : $+        $#suucp $@ $1 $: $2    @host.UUCP: ...
  1571. ! R$+ < @ $=Y . UUCP >        $#suucp $@ $2 $: $1    user@host.UUCP
  1572. ! R< @ $=U . UUCP > : $+        $#uucp $@ $1 $: $2    @host.UUCP: ...
  1573. ! R$+ < @ $=U . UUCP >        $#uucp $@ $2 $: $1    user@host.UUCP
  1574.   POPDIVERT
  1575. --- 125,157 ----
  1576.   # pass everything to standard SMTP mailer rewriting
  1577.   R$*                $@ $>11 $1
  1578.   
  1579. + #
  1580. + #  envelope sender rewriting for uucp-uudom mailer
  1581. + #
  1582. + S72
  1583.   
  1584. + # handle error address as a special case
  1585. + R<@>                $n            errors to mailer-daemon
  1586. + # do not qualify list:; syntax
  1587. + R$* :; <@>            $@ $1 :;
  1588. + R$* < @ $* . >            $1 < @ $2 >        strip trailing dots
  1589. + R$* < @ $=w >            $1            strip local name
  1590. + R<@ $- . UUCP > : $+        $1 ! $2            convert to UUCP format
  1591. + R<@ $+ > : $+            $1 ! $2            convert to UUCP format
  1592. + R$* < @ $- . UUCP >        $2 ! $1            convert to UUCP format
  1593. + R$* < @ $+ >            $@ $2 ! $1        convert to UUCP format
  1594. + R$&h ! $+ ! $+            $@ $1 ! $2        $h!...!user => ...!user
  1595. + R$&h ! $+            $@ $&h ! $1        $h!user => $h!user
  1596. + R$+                $: $M ! $1        prepend masquerade name
  1597. + R! $+                $: $j ! $1        in case $M undefined')
  1598.   PUSHDIVERT(4)
  1599.   # resolve locally connected UUCP links
  1600. ! R$* < @ $=Z . UUCP. > $*    $#uucp-uudom $@ $1 $: $1 < @ $2 .UUCP. > $3    @host.UUCP: ...
  1601. ! R$* < @ $=Y . UUCP. > $*    $#uucp-new $@ $2 $: $1 < @ $2 .UUCP. > $3
  1602. ! R$* < @ $=U . UUCP. > $*    $#uucp-old $@ $2 $: $1 < @ $2 .UUCP. > $3
  1603.   POPDIVERT
  1604. *** cf/ostype/bsdi1.0.m4.OLD    Sat Dec 11 13:05:45 1993
  1605. --- cf/ostype/bsdi1.0.m4    Sat Dec 11 13:05:41 1993
  1606. ***************
  1607. *** 0 ****
  1608. --- 1,38 ----
  1609. + divert(-1)
  1610. + #
  1611. + # Copyright (c) 1983 Eric P. Allman
  1612. + # Copyright (c) 1988, 1993
  1613. + #    The Regents of the University of California.  All rights reserved.
  1614. + #
  1615. + # Redistribution and use in source and binary forms, with or without
  1616. + # modification, are permitted provided that the following conditions
  1617. + # are met:
  1618. + # 1. Redistributions of source code must retain the above copyright
  1619. + #    notice, this list of conditions and the following disclaimer.
  1620. + # 2. Redistributions in binary form must reproduce the above copyright
  1621. + #    notice, this list of conditions and the following disclaimer in the
  1622. + #    documentation and/or other materials provided with the distribution.
  1623. + # 3. All advertising materials mentioning features or use of this software
  1624. + #    must display the following acknowledgement:
  1625. + #    This product includes software developed by the University of
  1626. + #    California, Berkeley and its contributors.
  1627. + # 4. Neither the name of the University nor the names of its contributors
  1628. + #    may be used to endorse or promote products derived from this software
  1629. + #    without specific prior written permission.
  1630. + #
  1631. + # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1632. + # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1633. + # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1634. + # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1635. + # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1636. + # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1637. + # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1638. + # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1639. + # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1640. + # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1641. + # SUCH DAMAGE.
  1642. + #
  1643. + divert(0)
  1644. + VERSIONID(`@(#)bsdi1.0.m4    8.1 (Berkeley) 12/11/93')dnl
  1645. + OSTYPE(bsd4.4)
  1646. *** cf/ostype/dgux.m4.OLD    Sat Nov 27 09:28:04 1993
  1647. --- cf/ostype/dgux.m4    Sat Nov 27 09:25:45 1993
  1648. ***************
  1649. *** 0 ****
  1650. --- 1,39 ----
  1651. + divert(-1)
  1652. + #
  1653. + # Copyright (c) 1983 Eric P. Allman
  1654. + # Copyright (c) 1988, 1993
  1655. + #    The Regents of the University of California.  All rights reserved.
  1656. + #
  1657. + # Redistribution and use in source and binary forms, with or without
  1658. + # modification, are permitted provided that the following conditions
  1659. + # are met:
  1660. + # 1. Redistributions of source code must retain the above copyright
  1661. + #    notice, this list of conditions and the following disclaimer.
  1662. + # 2. Redistributions in binary form must reproduce the above copyright
  1663. + #    notice, this list of conditions and the following disclaimer in the
  1664. + #    documentation and/or other materials provided with the distribution.
  1665. + # 3. All advertising materials mentioning features or use of this software
  1666. + #    must display the following acknowledgement:
  1667. + #    This product includes software developed by the University of
  1668. + #    California, Berkeley and its contributors.
  1669. + # 4. Neither the name of the University nor the names of its contributors
  1670. + #    may be used to endorse or promote products derived from this software
  1671. + #    without specific prior written permission.
  1672. + #
  1673. + # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1674. + # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1675. + # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1676. + # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1677. + # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1678. + # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1679. + # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1680. + # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1681. + # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1682. + # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1683. + # SUCH DAMAGE.
  1684. + #
  1685. + divert(0)
  1686. + VERSIONID(`@(#)dgux.m4    8.1 (Berkeley) 11/27/93')
  1687. + define(`LOCAL_MAILER_FLAGS', m)dnl
  1688. + define(`confTIME_ZONE', `USE_TZ')dnl
  1689. *** cf/ostype/dynix3.2.m4.OLD    Sat Nov 27 14:28:30 1993
  1690. --- cf/ostype/dynix3.2.m4    Sat Nov 27 14:28:24 1993
  1691. ***************
  1692. *** 0 ****
  1693. --- 1,39 ----
  1694. + divert(-1)
  1695. + #
  1696. + # Copyright (c) 1983 Eric P. Allman
  1697. + # Copyright (c) 1988, 1993
  1698. + #    The Regents of the University of California.  All rights reserved.
  1699. + #
  1700. + # Redistribution and use in source and binary forms, with or without
  1701. + # modification, are permitted provided that the following conditions
  1702. + # are met:
  1703. + # 1. Redistributions of source code must retain the above copyright
  1704. + #    notice, this list of conditions and the following disclaimer.
  1705. + # 2. Redistributions in binary form must reproduce the above copyright
  1706. + #    notice, this list of conditions and the following disclaimer in the
  1707. + #    documentation and/or other materials provided with the distribution.
  1708. + # 3. All advertising materials mentioning features or use of this software
  1709. + #    must display the following acknowledgement:
  1710. + #    This product includes software developed by the University of
  1711. + #    California, Berkeley and its contributors.
  1712. + # 4. Neither the name of the University nor the names of its contributors
  1713. + #    may be used to endorse or promote products derived from this software
  1714. + #    without specific prior written permission.
  1715. + #
  1716. + # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1717. + # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1718. + # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1719. + # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1720. + # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1721. + # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1722. + # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1723. + # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1724. + # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1725. + # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1726. + # SUCH DAMAGE.
  1727. + #
  1728. + divert(0)
  1729. + VERSIONID(`@(#)dynix3.2.m4    8.1 (Berkeley) 11/27/93')
  1730. + define(`ALIAS_FILE', /usr/lib/aliases)dnl
  1731. + define(`QUEUE_DIR', /usr/spool/mqueue)dnl
  1732. *** cf/ostype/hpux.m4.OLD    Tue Aug 24 20:31:55 1993
  1733. --- cf/ostype/hpux.m4    Sun Jan  9 09:50:51 1994
  1734. ***************
  1735. *** 34,43 ****
  1736.   #
  1737.   
  1738.   divert(0)
  1739. ! VERSIONID(`@(#)hpux.m4    8.4 (Berkeley) 8/24/93')
  1740.   
  1741.   define(`QUEUE_DIR', /usr/spool/mqueue)dnl
  1742.   define(`ALIAS_FILE', /usr/lib/aliases)dnl
  1743.   define(`STATUS_FILE', /usr/lib/sendmail.st)dnl
  1744.   define(`LOCAL_MAILER_FLAGS', `m')dnl
  1745.   define(`confTIME_ZONE', `USE_TZ')dnl
  1746. --- 34,44 ----
  1747.   #
  1748.   
  1749.   divert(0)
  1750. ! VERSIONID(`@(#)hpux.m4    8.5 (Berkeley) 1/9/94')
  1751.   
  1752.   define(`QUEUE_DIR', /usr/spool/mqueue)dnl
  1753.   define(`ALIAS_FILE', /usr/lib/aliases)dnl
  1754.   define(`STATUS_FILE', /usr/lib/sendmail.st)dnl
  1755.   define(`LOCAL_MAILER_FLAGS', `m')dnl
  1756. + define(`UUCP_MAILER_ARGS', `uux - -r -a$f -gC $h!rmail ($u)')dnl
  1757.   define(`confTIME_ZONE', `USE_TZ')dnl
  1758. *** cf/ostype/irix.m4.OLD    Sat Nov 27 09:28:44 1993
  1759. --- cf/ostype/irix.m4    Sat Nov 27 09:29:26 1993
  1760. ***************
  1761. *** 34,38 ****
  1762.   #
  1763.   
  1764.   divert(0)
  1765. ! VERSIONID(`@(#)irix.m4    8.2 (Berkeley) 8/8/93')
  1766.   define(`LOCAL_MAILER_FLAGS', Ehmu)dnl
  1767. --- 34,41 ----
  1768.   #
  1769.   
  1770.   divert(0)
  1771. ! VERSIONID(`@(#)irix.m4    8.3 (Berkeley) 11/27/93')
  1772.   define(`LOCAL_MAILER_FLAGS', Ehmu)dnl
  1773. + define(`QUEUE_DIR', /usr/spool/mqueue)dnl
  1774. + define(`ALIAS_FILE', /usr/lib/aliases)dnl
  1775. + define(`STATUS_FILE', /usr/lib/sendmail.st)dnl
  1776. *** cf/ostype/nextstep.m4.OLD    Wed Nov 10 17:07:58 1993
  1777. --- cf/ostype/nextstep.m4    Tue Nov 30 09:01:49 1993
  1778. ***************
  1779. *** 34,42 ****
  1780.   #
  1781.   
  1782.   divert(0)
  1783. ! VERSIONID(`@(#)nextstep.m4    8.3 (Berkeley) 8/13/93')
  1784.   define(`ALIAS_FILE', /etc/sendmail/aliases)dnl
  1785.   define(`HELP_FILE', /usr/lib/sendmail.hf)dnl
  1786.   define(`STATUS_FILE', /etc/sendmail/sendmail.st)dnl
  1787.   define(`UUCP_MAILER_PATH', /usr/bin/uux)dnl
  1788.   define(`QUEUE_DIR', /usr/spool/mqueue)dnl
  1789. --- 34,44 ----
  1790.   #
  1791.   
  1792.   divert(0)
  1793. ! VERSIONID(`@(#)nextstep.m4    8.4 (Berkeley) 11/30/93')
  1794.   define(`ALIAS_FILE', /etc/sendmail/aliases)dnl
  1795.   define(`HELP_FILE', /usr/lib/sendmail.hf)dnl
  1796.   define(`STATUS_FILE', /etc/sendmail/sendmail.st)dnl
  1797.   define(`UUCP_MAILER_PATH', /usr/bin/uux)dnl
  1798.   define(`QUEUE_DIR', /usr/spool/mqueue)dnl
  1799. + define(`LOCAL_MAILER_FLAGS', `rmnP')dnl
  1800. + define(`LOCAL_SHELL_FLAGS', `euP')dnl
  1801. *** cf/ostype/riscos4.5.m4.OLD    Wed Dec  1 07:54:37 1993
  1802. --- cf/ostype/riscos4.5.m4    Wed Dec  1 08:44:17 1993
  1803. ***************
  1804. *** 34,37 ****
  1805.   #
  1806.   
  1807.   divert(0)
  1808. ! VERSIONID(`@(#)riscos4.5.m4    8.1 (Berkeley) 6/7/93')
  1809. --- 34,42 ----
  1810.   #
  1811.   
  1812.   divert(0)
  1813. ! VERSIONID(`@(#)riscos4.5.m4    8.2 (Berkeley) 12/1/93')
  1814. ! define(`LOCAL_MAILER_ARGS', `rmail -d $u')dnl
  1815. ! define(`ALIAS_FILE', `/usr/lib/aliases')dnl
  1816. ! define(`QUEUE_DIR', `/usr/spool/mqueue')dnl
  1817. ! define(`HELP_FILE', `/usr/lib/sendmail.hf')dnl
  1818. *** cf/ostype/sco3.2.m4.OLD    Sat Nov 27 10:29:19 1993
  1819. --- cf/ostype/sco3.2.m4    Sat Nov 27 10:29:10 1993
  1820. ***************
  1821. *** 0 ****
  1822. --- 1,45 ----
  1823. + divert(-1)
  1824. + #
  1825. + # Copyright (c) 1983 Eric P. Allman
  1826. + # Copyright (c) 1988, 1993
  1827. + #    The Regents of the University of California.  All rights reserved.
  1828. + #
  1829. + # Redistribution and use in source and binary forms, with or without
  1830. + # modification, are permitted provided that the following conditions
  1831. + # are met:
  1832. + # 1. Redistributions of source code must retain the above copyright
  1833. + #    notice, this list of conditions and the following disclaimer.
  1834. + # 2. Redistributions in binary form must reproduce the above copyright
  1835. + #    notice, this list of conditions and the following disclaimer in the
  1836. + #    documentation and/or other materials provided with the distribution.
  1837. + # 3. All advertising materials mentioning features or use of this software
  1838. + #    must display the following acknowledgement:
  1839. + #    This product includes software developed by the University of
  1840. + #    California, Berkeley and its contributors.
  1841. + # 4. Neither the name of the University nor the names of its contributors
  1842. + #    may be used to endorse or promote products derived from this software
  1843. + #    without specific prior written permission.
  1844. + #
  1845. + # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1846. + # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1847. + # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1848. + # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1849. + # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1850. + # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1851. + # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1852. + # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1853. + # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1854. + # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1855. + # SUCH DAMAGE.
  1856. + #
  1857. + divert(0)
  1858. + VERSIONID(`@(#)sco32.m4    8.1 (Berkeley) 11/27/93')
  1859. + define(`ALIAS_FILE', /usr/lib/mail/aliases)dnl
  1860. + define(`QUEUE_DIR', /usr/spool/mqueue)dnl
  1861. + define(`STATUS_FILE', /usr/lib/sendmail.st)dnl
  1862. + define(`UUCP_MAILER_PATH', /usr/bin/uux)dnl
  1863. + define(`LOCAL_MAILER_PATH', /usr/bin/lmail)dnl
  1864. + define(`LOCAL_MAILER_FLAGS', PuhCE)dnl
  1865. + define(`LOCAL_MAILER_ARGS', `lmail $u')dnl
  1866. + define(`LOCAL_SHELL_FLAGS', Peu)dnl
  1867. *** doc/op/op.me.OLD    Fri Nov 12 09:44:20 1993
  1868. --- doc/op/op.me    Wed Jan 12 06:52:00 1994
  1869. ***************
  1870. *** 30,36 ****
  1871.   .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1872.   .\" SUCH DAMAGE.
  1873.   .\"
  1874. ! .\"    @(#)op.me    8.26 (Berkeley) 10/14/93
  1875.   .\"
  1876.   .\" eqn op.me | pic | troff -me
  1877.   .eh 'SMM:08-%''Sendmail Installation and Operation Guide'
  1878. --- 30,36 ----
  1879.   .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1880.   .\" SUCH DAMAGE.
  1881.   .\"
  1882. ! .\"    @(#)op.me    8.32 (Berkeley) 1/12/94
  1883.   .\"
  1884.   .\" eqn op.me | pic | troff -me
  1885.   .eh 'SMM:08-%''Sendmail Installation and Operation Guide'
  1886. ***************
  1887. *** 69,75 ****
  1888.   Mammoth Project
  1889.   eric@CS.Berkeley.EDU
  1890.   .sp
  1891. ! Version 8.26
  1892.   .sp
  1893.   For Sendmail Version 8.6
  1894.   .)l
  1895. --- 69,75 ----
  1896.   Mammoth Project
  1897.   eric@CS.Berkeley.EDU
  1898.   .sp
  1899. ! Version 8.32
  1900.   .sp
  1901.   For Sendmail Version 8.6
  1902.   .)l
  1903. ***************
  1904. *** 185,191 ****
  1905.   on 4.4BSD.
  1906.   .pp
  1907.   If you are loading this off the tape,
  1908. ! continue with the next session.
  1909.   If you have a running binary already on your system,
  1910.   you should probably skip to section 1.2.
  1911.   .sh 2 "Compiling Sendmail"
  1912. --- 185,191 ----
  1913.   on 4.4BSD.
  1914.   .pp
  1915.   If you are loading this off the tape,
  1916. ! continue with the next section.
  1917.   If you have a running binary already on your system,
  1918.   you should probably skip to section 1.2.
  1919.   .sh 2 "Compiling Sendmail"
  1920. ***************
  1921. *** 576,590 ****
  1922.   of this document.
  1923.   .sh 3 "/usr/\*(SB/newaliases"
  1924.   .pp
  1925. ! If you are running delivermail,
  1926. ! it is critical that the
  1927.   .i newaliases
  1928. ! command be replaced.
  1929. ! This can just be a link to
  1930.   .i sendmail :
  1931.   .(b
  1932.   rm \-f /usr/\*(SB/newaliases
  1933. ! ln /usr/\*(SD/sendmail /usr/\*(SB/newaliases
  1934.   .)b
  1935.   This can be installed in whatever search path you prefer
  1936.   for your system.
  1937. --- 576,588 ----
  1938.   of this document.
  1939.   .sh 3 "/usr/\*(SB/newaliases"
  1940.   .pp
  1941. ! The
  1942.   .i newaliases
  1943. ! command should just be a link to
  1944.   .i sendmail :
  1945.   .(b
  1946.   rm \-f /usr/\*(SB/newaliases
  1947. ! ln \-s /usr/\*(SD/sendmail /usr/\*(SB/newaliases
  1948.   .)b
  1949.   This can be installed in whatever search path you prefer
  1950.   for your system.
  1951. ***************
  1952. *** 808,813 ****
  1953. --- 806,816 ----
  1954.   The system log is supported by the
  1955.   .i syslogd \|(8)
  1956.   program.
  1957. + All messages from
  1958. + .i sendmail
  1959. + are logged under the
  1960. + .sm LOG_MAIL
  1961. + facility.
  1962.   .sh 3 "Format"
  1963.   .pp
  1964.   Each line in the system log
  1965. ***************
  1966. *** 994,999 ****
  1967. --- 997,1012 ----
  1968.   .q mail.aliases
  1969.   in
  1970.   .q my.nis.domain .
  1971. + Warning: if you build your own
  1972. + .sm NIS -based
  1973. + alias files,
  1974. + be sure to provide the
  1975. + .b \-l
  1976. + flag to
  1977. + .i makedbm (8)
  1978. + to map upper case letters in the keys to lower case;
  1979. + otherwise, aliases with upper case letters in their names
  1980. + won't match incoming addresses.
  1981.   .pp
  1982.   Additional flags can be added after the colon
  1983.   exactly like a
  1984. ***************
  1985. *** 1074,1084 ****
  1986.   .q a
  1987.   option is required in the configuration
  1988.   for this action to occur.
  1989. ! This should normally be specified
  1990. ! unless you are running
  1991. ! .i delivermail
  1992. ! in parallel with
  1993. ! .i sendmail.
  1994.   .)f
  1995.   .sh 3 "List owners"
  1996.   .pp
  1997. --- 1087,1093 ----
  1998.   .q a
  1999.   option is required in the configuration
  2000.   for this action to occur.
  2001. ! This should normally be specified.
  2002.   .)f
  2003.   .sh 3 "List owners"
  2004.   .pp
  2005. ***************
  2006. *** 1438,1443 ****
  2007. --- 1447,1464 ----
  2008.   .i sendmail ,
  2009.   including the incoming SMTP traffic,
  2010.   will be logged in this file.
  2011. + .sh 2 "Dumping State"
  2012. + .pp
  2013. + You can ask
  2014. + .i sendmail
  2015. + to log a dump of the open files
  2016. + and the connection cache
  2017. + by sending it a
  2018. + .sm SIGUSR1
  2019. + signal.
  2020. + The results are logged at
  2021. + .sm LOG_DEBUG
  2022. + priority.
  2023.   .sh 1 "TUNING"
  2024.   .pp
  2025.   There are a number of configuration parameters
  2026. ***************
  2027. *** 2381,2387 ****
  2028.   .b $)
  2029.   syntax is a more general form of lookup;
  2030.   it uses a named map instead of an implicit map.
  2031. ! If no lookup is found, the indicted
  2032.   .i default
  2033.   is inserted;
  2034.   if no default is specified and no lookup matches,
  2035. --- 2402,2408 ----
  2036.   .b $)
  2037.   syntax is a more general form of lookup;
  2038.   it uses a named map instead of an implicit map.
  2039. ! If no lookup is found, the indicated
  2040.   .i default
  2041.   is inserted;
  2042.   if no default is specified and no lookup matches,
  2043. ***************
  2044. *** 2444,2455 ****
  2045.   may be a colon-separated list of hosts
  2046.   that are searched in order for the first working address
  2047.   (exactly like MX records).
  2048.   .pp
  2049.   A RHS may also be preceded by a
  2050.   .b $@
  2051.   or a
  2052.   .b $:
  2053. ! to control evaluation.
  2054.   A
  2055.   .b $@
  2056.   prefix causes the ruleset to return with the remainder of the RHS
  2057. --- 2465,2485 ----
  2058.   may be a colon-separated list of hosts
  2059.   that are searched in order for the first working address
  2060.   (exactly like MX records).
  2061. + The
  2062. + .i user
  2063. + is later rewritten by the mailer-specific envelope rewriting set
  2064. + and assigned to the
  2065. + .b $u
  2066. + macro.
  2067.   .pp
  2068. + Normally, a ruleset that matches is retried,
  2069. + that is,
  2070. + the ruleset loops until it fails.
  2071.   A RHS may also be preceded by a
  2072.   .b $@
  2073.   or a
  2074.   .b $:
  2075. ! to change this behavior.
  2076.   A
  2077.   .b $@
  2078.   prefix causes the ruleset to return with the remainder of the RHS
  2079. ***************
  2080. *** 2794,2800 ****
  2081.   Defaults to
  2082.   .q MAILER-DAEMON .
  2083.   .ip $o\(dg
  2084. ! .b "The set of "operators" in addresses."
  2085.   A list of characters
  2086.   which will be considered tokens
  2087.   and which will separate tokens
  2088. --- 2824,2830 ----
  2089.   Defaults to
  2090.   .q MAILER-DAEMON .
  2091.   .ip $o\(dg
  2092. ! .b "The set of \*(lqoperators\*(rq in addresses."
  2093.   A list of characters
  2094.   which will be considered tokens
  2095.   and which will separate tokens
  2096. ***************
  2097. *** 3109,3114 ****
  2098. --- 3139,3165 ----
  2099.   is set to be the same as
  2100.   .b $k ,
  2101.   that is, the UUCP node name.
  2102. + .pp
  2103. + The class
  2104. + .b $=m
  2105. + is set to the set of domains by which this host is known,
  2106. + initially just
  2107. + .b $m .
  2108. + .pp
  2109. + .i Sendmail
  2110. + can be compiled to allow a
  2111. + .i scanf (3)
  2112. + string on the
  2113. + .b F
  2114. + line.
  2115. + This lets you do simplistic parsing of text files.
  2116. + For example, to read all the user names in your system
  2117. + .i /etc/passwd
  2118. + file into a class, use
  2119. + .(b
  2120. + FL/etc/passwd %[^:]
  2121. + .)b
  2122. + which reads every line up to the first colon.
  2123.   .sh 3 "M \*- define mailer"
  2124.   .pp
  2125.   Programs and interfaces to mailers
  2126. ***************
  2127. *** 3698,3704 ****
  2128.   .ip k\fIN\fP
  2129.   The maximum number of open connections that will be cached at a time.
  2130.   The default is one.
  2131. ! This delays closing the the current connection until
  2132.   either this invocation of
  2133.   .i sendmail
  2134.   needs to connect to another host
  2135. --- 3749,3755 ----
  2136.   .ip k\fIN\fP
  2137.   The maximum number of open connections that will be cached at a time.
  2138.   The default is one.
  2139. ! This delays closing the current connection until
  2140.   either this invocation of
  2141.   .i sendmail
  2142.   needs to connect to another host
  2143. ***************
  2144. *** 3794,3799 ****
  2145. --- 3845,3851 ----
  2146.   restrictmailq    Restrict mailq command
  2147.   restrictqrun    Restrict \-q command line flag
  2148.   goaway    Disallow essentially all SMTP status queries
  2149. + authwarnings    Put X-Authentication-Warning: headers in messages
  2150.   .)b
  2151.   The
  2152.   .q goaway
  2153. ***************
  2154. *** 3807,3812 ****
  2155. --- 3859,3867 ----
  2156.   If queue runs are restricted,
  2157.   only root and the owner of the queue directory
  2158.   can run the queue.
  2159. + Authentication Warnings add warnings about various conditions
  2160. + that may indicate attempts to spoof the mail system,
  2161. + such as using an non-standard queue directory.
  2162.   .ip P\fIpostmaster\fP
  2163.   If set,
  2164.   copies of error messages will be sent to the named
  2165. ***************
  2166. *** 3893,3899 ****
  2167.   even if you are going to attempt immediate delivery.
  2168.   .i Sendmail
  2169.   always instantiates the queue file
  2170. ! before returning control the the client
  2171.   under any circumstances.
  2172.   .ip S\fIfile\fP
  2173.   Log statistics in the named
  2174. --- 3948,3954 ----
  2175.   even if you are going to attempt immediate delivery.
  2176.   .i Sendmail
  2177.   always instantiates the queue file
  2178. ! before returning control the client
  2179.   under any circumstances.
  2180.   .ip S\fIfile\fP
  2181.   Log statistics in the named
  2182. ***************
  2183. *** 4165,4170 ****
  2184. --- 4220,4240 ----
  2185.   change the default definition of
  2186.   .b $w
  2187.   to be just the first component of the hostname.
  2188. + .pp
  2189. + The
  2190. + .b V
  2191. + line may have an optional
  2192. + .b / \c
  2193. + .i vendor
  2194. + to indicate that this configuration file uses modifications
  2195. + specific to a particular vendor\**.
  2196. + .(f
  2197. + \**And of course, vendors are encouraged to add themselves
  2198. + to the list of recognized vendors by editing the routine
  2199. + .i setvendor
  2200. + in
  2201. + .i conf.c .
  2202. + .)f
  2203.   .sh 3 "K \*- key file declaration"
  2204.   .pp
  2205.   Special maps can be defined using the line:
  2206. ***************
  2207. *** 4265,4271 ****
  2208.   and the third requires that
  2209.   .i sendmail
  2210.   be compiled with NIS support.
  2211. ! All four accept as arguments the some optional flags
  2212.   and a filename
  2213.   (or a mapname for NIS;
  2214.   the filename is the root of the database path,
  2215. --- 4335,4341 ----
  2216.   and the third requires that
  2217.   .i sendmail
  2218.   be compiled with NIS support.
  2219. ! All four accept as arguments the same optional flags
  2220.   and a filename
  2221.   (or a mapname for NIS;
  2222.   the filename is the root of the database path,
  2223. ***************
  2224. *** 4616,4622 ****
  2225.   know exactly where each network connection is,
  2226.   possibly including the names of each host on that network.
  2227.   As long as the site remains small
  2228. ! and the the configuration remains relatively static,
  2229.   the update problem will probably not be too great.
  2230.   .sh 4 "Single host"
  2231.   .pp
  2232. --- 4686,4692 ----
  2233.   know exactly where each network connection is,
  2234.   possibly including the names of each host on that network.
  2235.   As long as the site remains small
  2236. ! and the configuration remains relatively static,
  2237.   the update problem will probably not be too great.
  2238.   .sh 4 "Single host"
  2239.   .pp
  2240. ***************
  2241. *** 4944,4951 ****
  2242.   .i "if and only if"
  2243.   the
  2244.   .q C
  2245. ! flag is defined in the mailer corresponding to
  2246. ! .q eric@vangogh.CS.Berkeley.EDU.
  2247.   .pp
  2248.   Other flags are described
  2249.   in Appendix C.
  2250. --- 5014,5023 ----
  2251.   .i "if and only if"
  2252.   the
  2253.   .q C
  2254. ! flag is defined in the mailer resolved to
  2255. ! by running
  2256. ! .q eric@vangogh.CS.Berkeley.EDU
  2257. ! through rulesets 3 and 0.
  2258.   .pp
  2259.   Other flags are described
  2260.   in Appendix C.
  2261. ***************
  2262. *** 4998,5004 ****
  2263.   may be used.
  2264.   .pp
  2265.   Finally,
  2266. ! an argv template is given as the E field.
  2267.   It may have embedded spaces.
  2268.   If there is no argv with a
  2269.   .b $u
  2270. --- 5070,5076 ----
  2271.   may be used.
  2272.   .pp
  2273.   Finally,
  2274. ! an argv template is given as the A field.
  2275.   It may have embedded spaces.
  2276.   If there is no argv with a
  2277.   .b $u
  2278. ***************
  2279. *** 5175,5181 ****
  2280.   .q maildrop
  2281.   is found for the user,
  2282.   but no corresponding
  2283. ! .q maildrop
  2284.   record exists,
  2285.   the record
  2286.   .q :default:mailname
  2287. --- 5247,5253 ----
  2288.   .q maildrop
  2289.   is found for the user,
  2290.   but no corresponding
  2291. ! .q mailname
  2292.   record exists,
  2293.   the record
  2294.   .q :default:mailname
  2295. ***************
  2296. *** 5310,5316 ****
  2297.   The load average type.
  2298.   Details are described below.
  2299.   .lp
  2300. ! The are four built-in ways of computing the load average.
  2301.   .i Sendmail
  2302.   tries to auto-configure them based on imperfect guesses;
  2303.   you can select one using the
  2304. --- 5382,5388 ----
  2305.   The load average type.
  2306.   Details are described below.
  2307.   .lp
  2308. ! The are several built-in ways of computing the load average.
  2309.   .i Sendmail
  2310.   tries to auto-configure them based on imperfect guesses;
  2311.   you can select one using the
  2312. ***************
  2313. *** 5332,5337 ****
  2314. --- 5404,5411 ----
  2315.   .ip LA_FLOAT
  2316.   The kernel stores the load average in the kernel as an array of
  2317.   double precision floats.
  2318. + .ip LA_MACH
  2319. + Use MACH-style load averages.
  2320.   .ip LA_SUBR
  2321.   Call the
  2322.   .i getloadavg
  2323. ***************
  2324. *** 6009,6015 ****
  2325.   However, for compatibility with RFC 822,
  2326.   you can set option `7' to get seven bit stripping.
  2327.   .pp
  2328. ! Individual mailers can still produce seven bit out put using the
  2329.   `7' mailer flag.
  2330.   .sh 2 "User Database"
  2331.   .pp
  2332. --- 6083,6089 ----
  2333.   However, for compatibility with RFC 822,
  2334.   you can set option `7' to get seven bit stripping.
  2335.   .pp
  2336. ! Individual mailers can still produce seven bit output using the
  2337.   `7' mailer flag.
  2338.   .sh 2 "User Database"
  2339.   .pp
  2340. ***************
  2341. *** 6517,6525 ****
  2342.   This produces a lot of data very quickly and should be used sparingly.
  2343.   .pp
  2344.   There are a number of options that may be specified as
  2345. ! primitive flags
  2346. ! (provided for compatibility with
  2347. ! .i delivermail ).
  2348.   These are the e, i, m, and v options.
  2349.   Also,
  2350.   the f option
  2351. --- 6591,6597 ----
  2352.   This produces a lot of data very quickly and should be used sparingly.
  2353.   .pp
  2354.   There are a number of options that may be specified as
  2355. ! primitive flags.
  2356.   These are the e, i, m, and v options.
  2357.   Also,
  2358.   the f option
  2359. ***************
  2360. *** 6803,6809 ****
  2361.   .\"Eric Allman
  2362.   .\"Britton-Lee, Inc.
  2363.   .\".sp
  2364. ! .\"Version 8.26
  2365.   .\".ce 0
  2366.   .bp 2
  2367.   .rs
  2368. --- 6875,6881 ----
  2369.   .\"Eric Allman
  2370.   .\"Britton-Lee, Inc.
  2371.   .\".sp
  2372. ! .\"Version 8.32
  2373.   .\".ce 0
  2374.   .bp 2
  2375.   .rs
  2376. *** mailstats/mailstats.c.OLD    Tue Jul 27 10:38:56 1993
  2377. --- mailstats/mailstats.c    Mon Dec 27 17:07:17 1993
  2378. ***************
  2379. *** 40,46 ****
  2380.   #endif /* not lint */
  2381.   
  2382.   #ifndef lint
  2383. ! static char sccsid[] = "@(#)mailstats.c    8.2 (Berkeley) 7/27/93";
  2384.   #endif /* not lint */
  2385.   
  2386.   #include <sendmail.h>
  2387. --- 40,46 ----
  2388.   #endif /* not lint */
  2389.   
  2390.   #ifndef lint
  2391. ! static char sccsid[] = "@(#)mailstats.c    8.3 (Berkeley) 12/27/93";
  2392.   #endif /* not lint */
  2393.   
  2394.   #include <sendmail.h>
  2395. ***************
  2396. *** 63,68 ****
  2397. --- 63,69 ----
  2398.       char *cfile;
  2399.       FILE *cfp;
  2400.       bool mnames;
  2401. +     long frmsgs = 0, frbytes = 0, tomsgs = 0, tobytes = 0;
  2402.       char mtable[MAXMAILERS][MNAMELEN+1];
  2403.       char sfilebuf[100];
  2404.       char buf[MAXLINE];
  2405. ***************
  2406. *** 195,201 ****
  2407. --- 196,209 ----
  2408.               if (mnames)
  2409.                   printf("  %s", mtable[i]);
  2410.               printf("\n");
  2411. +             frmsgs += stat.stat_nf[i];
  2412. +             frbytes += stat.stat_bf[i];
  2413. +             tomsgs += stat.stat_nt[i];
  2414. +             tobytes += stat.stat_bt[i];
  2415.           }
  2416.       }
  2417. +     printf("========================================\n");
  2418. +     printf(" T %6ld %10ldK %6ld %10ldK\n",
  2419. +         frmsgs, frbytes, tomsgs, tobytes);
  2420.       exit(EX_OK);
  2421.   }
  2422. *** makemap/Makefile.dist.OLD    Wed Dec  1 09:17:58 1993
  2423. --- makemap/Makefile.dist    Sat Nov 27 09:07:40 1993
  2424. ***************
  2425. *** 0 ****
  2426. --- 1,81 ----
  2427. + #
  2428. + #  This Makefile is designed to work on the old "make" program.  It does
  2429. + #  not use the obj subdirectory.  It also does not install documentation
  2430. + #  automatically -- think of it as a quick start for sites that have the
  2431. + #  old make program (I recommend that you get and port the new make if you
  2432. + #  are going to be doing any signficant work on sendmail).
  2433. + #
  2434. + #    @(#)Makefile.dist    8.2 (Berkeley) 11/27/93
  2435. + #
  2436. + # use O=-O (usual) or O=-g (debugging)
  2437. + O=    -O
  2438. + # location of sendmail source directory
  2439. + SRCDIR=    ../src
  2440. + # define the database mechanisms available for map & alias lookups:
  2441. + #    -DNDBM -- use new DBM
  2442. + #    -DNEWDB -- use new Berkeley DB
  2443. + # The really old (V7) DBM library is no longer supported.
  2444. + #
  2445. + DBMDEF=    -DNDBM -DNEWDB
  2446. + # environment definitions (e.g., -D_AIX3)
  2447. + ENVDEF=
  2448. + # see also conf.h for additional compilation flags
  2449. + # include directories
  2450. + INCDIRS=-I${SRCDIR} -I/usr/sww/include/db
  2451. + # loader options
  2452. + LDOPTS=
  2453. + # library directories
  2454. + LIBDIRS=-L/usr/sww/lib
  2455. + # libraries required on your system
  2456. + LIBS=    -ldb -ldbm
  2457. + # location of makemap binary (usually /usr/sbin or /usr/etc)
  2458. + BINDIR=    ${DESTDIR}/usr/sbin
  2459. + # additional .o files needed
  2460. + OBJADD=
  2461. + ###################  end of user configuration flags  ######################
  2462. + CFLAGS=    -I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
  2463. + OBJS=    makemap.o ${OBJADD}
  2464. + LINKS=    ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
  2465. + BINOWN=    bin
  2466. + BINGRP=    bin
  2467. + BINMODE=555
  2468. + ALL=    makemap makemap.0
  2469. + all: ${ALL}
  2470. + makemap: ${BEFORE} ${OBJS}
  2471. +     ${CC} -o makemap ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
  2472. + makemap.0: makemap.8
  2473. +     nroff -h -mandoc makemap.8 > makemap.0
  2474. + install: install-makemap install-docs
  2475. + install-makemap: makemap
  2476. +     install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} makemap ${BINDIR}
  2477. + # doesn't actually install them -- you may want to install pre-nroff versions
  2478. + install-docs: makemap.0
  2479. + clean:
  2480. +     rm -f ${OBJS} makemap makemap.0
  2481. + # dependencies
  2482. + #   gross overkill, and yet still not quite enough....
  2483. + ${OBJS}: ${SRCDIR}/conf.h
  2484. *** makemap/makemap.c.OLD    Mon Nov 22 11:26:28 1993
  2485. --- makemap/makemap.c    Mon Nov 22 11:44:10 1993
  2486. ***************
  2487. *** 33,39 ****
  2488.    */
  2489.   
  2490.   #ifndef lint
  2491. ! static char sccsid[] = "@(#)makemap.c    8.5 (Berkeley) 9/22/93";
  2492.   #endif /* not lint */
  2493.   
  2494.   #include <stdio.h>
  2495. --- 33,39 ----
  2496.    */
  2497.   
  2498.   #ifndef lint
  2499. ! static char sccsid[] = "@(#)makemap.c    8.6 (Berkeley) 11/22/93";
  2500.   #endif /* not lint */
  2501.   
  2502.   #include <stdio.h>
  2503. ***************
  2504. *** 262,269 ****
  2505.           */
  2506.   
  2507.           p = strchr(ibuf, '\n');
  2508. !         if (*p != '\0')
  2509.               *p = '\0';
  2510.           if (ibuf[0] == '\0' || ibuf[0] == '#')
  2511.               continue;
  2512.           if (isspace(ibuf[0]))
  2513. --- 262,276 ----
  2514.           */
  2515.   
  2516.           p = strchr(ibuf, '\n');
  2517. !         if (p != NULL)
  2518.               *p = '\0';
  2519. +         else if (!feof(stdin))
  2520. +         {
  2521. +             fprintf(stderr, "%s: %s: line %d: line too long (%d bytes max)\n",
  2522. +                 progname, mapname, lineno, sizeof ibuf);
  2523. +             continue;
  2524. +         }
  2525. +             
  2526.           if (ibuf[0] == '\0' || ibuf[0] == '#')
  2527.               continue;
  2528.           if (isspace(ibuf[0]))
  2529. *** praliases/Makefile.dist.OLD    Wed Dec  1 09:18:02 1993
  2530. --- praliases/Makefile.dist    Sat Nov 27 09:07:26 1993
  2531. ***************
  2532. *** 0 ****
  2533. --- 1,81 ----
  2534. + #
  2535. + #  This Makefile is designed to work on the old "make" program.  It does
  2536. + #  not use the obj subdirectory.  It also does not install documentation
  2537. + #  automatically -- think of it as a quick start for sites that have the
  2538. + #  old make program (I recommend that you get and port the new make if you
  2539. + #  are going to be doing any signficant work on sendmail).
  2540. + #
  2541. + #    @(#)Makefile.dist    8.1 (Berkeley) 11/27/93
  2542. + #
  2543. + # use O=-O (usual) or O=-g (debugging)
  2544. + O=    -O
  2545. + # location of sendmail source directory
  2546. + SRCDIR=    ../src
  2547. + # define the database mechanisms available for map & alias lookups:
  2548. + #    -DNDBM -- use new DBM
  2549. + #    -DNEWDB -- use new Berkeley DB
  2550. + # The really old (V7) DBM library is no longer supported.
  2551. + #
  2552. + DBMDEF=    -DNDBM -DNEWDB
  2553. + # environment definitions (e.g., -D_AIX3)
  2554. + ENVDEF=
  2555. + # see also conf.h for additional compilation flags
  2556. + # include directories
  2557. + INCDIRS=-I${SRCDIR} -I/usr/sww/include/db
  2558. + # loader options
  2559. + LDOPTS=
  2560. + # library directories
  2561. + LIBDIRS=-L/usr/sww/lib
  2562. + # libraries required on your system
  2563. + LIBS=    -ldb -ldbm
  2564. + # location of praliases binary (usually /usr/sbin or /usr/etc)
  2565. + BINDIR=    ${DESTDIR}/usr/sbin
  2566. + # additional .o files needed
  2567. + OBJADD=
  2568. + ###################  end of user configuration flags  ######################
  2569. + CFLAGS=    -I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
  2570. + OBJS=    praliases.o ${OBJADD}
  2571. + LINKS=    ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
  2572. + BINOWN=    bin
  2573. + BINGRP=    bin
  2574. + BINMODE=555
  2575. + ALL=    praliases praliases.0
  2576. + all: ${ALL}
  2577. + praliases: ${BEFORE} ${OBJS}
  2578. +     ${CC} -o praliases ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
  2579. + praliases.0: praliases.8
  2580. +     nroff -h -mandoc praliases.8 > praliases.0
  2581. + install: install-praliases install-docs
  2582. + install-praliases: praliases
  2583. +     install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} praliases ${BINDIR}
  2584. + # doesn't actually install them -- you may want to install pre-nroff versions
  2585. + install-docs: praliases.0
  2586. + clean:
  2587. +     rm -f ${OBJS} praliases praliases.0
  2588. + # dependencies
  2589. + #   gross overkill, and yet still not quite enough....
  2590. + ${OBJS}: ${SRCDIR}/conf.h
  2591. *** src/Makefile.OLD    Sun Aug 15 06:43:09 1993
  2592. --- src/Makefile    Mon Dec 20 10:52:10 1993
  2593. ***************
  2594. *** 1,4 ****
  2595. ! #    @(#)Makefile    8.2 (Berkeley) 8/15/93
  2596.   
  2597.   PROG=    sendmail
  2598.   
  2599. --- 1,4 ----
  2600. ! #    @(#)Makefile    8.3 (Berkeley) 12/20/93
  2601.   
  2602.   PROG=    sendmail
  2603.   
  2604. ***************
  2605. *** 34,40 ****
  2606.   beforeinstall:
  2607.   #    install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  2608.   #        ${DESTDIR}/etc/sendmail.fc
  2609. !     install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  2610.           ${DESTDIR}/var/log/sendmail.st
  2611.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/sendmail.hf \
  2612.           ${DESTDIR}/usr/share/misc
  2613. --- 34,40 ----
  2614.   beforeinstall:
  2615.   #    install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  2616.   #        ${DESTDIR}/etc/sendmail.fc
  2617. !     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  2618.           ${DESTDIR}/var/log/sendmail.st
  2619.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/sendmail.hf \
  2620.           ${DESTDIR}/usr/share/misc
  2621. *** src/Makefile.386BSD.OLD    Sat Dec 18 11:20:32 1993
  2622. --- src/Makefile.386BSD    Sat Dec 18 11:21:07 1993
  2623. ***************
  2624. *** 34,40 ****
  2625.   beforeinstall:
  2626.   #    install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  2627.   #        ${DESTDIR}/etc/sendmail.fc
  2628. !     install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  2629.           ${DESTDIR}/var/log/sendmail.st
  2630.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/sendmail.hf \
  2631.           ${DESTDIR}/usr/share/misc
  2632. --- 34,40 ----
  2633.   beforeinstall:
  2634.   #    install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  2635.   #        ${DESTDIR}/etc/sendmail.fc
  2636. !     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  2637.           ${DESTDIR}/var/log/sendmail.st
  2638.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/sendmail.hf \
  2639.           ${DESTDIR}/usr/share/misc
  2640. *** src/Makefile.AIX.OLD    Wed Dec  1 19:08:02 1993
  2641. --- src/Makefile.AIX    Mon Jan  3 07:06:46 1994
  2642. ***************
  2643. *** 5,11 ****
  2644.   #  old make program (I recommend that you get and port the new make if you
  2645.   #  are going to be doing any signficant work on sendmail).
  2646.   #
  2647. ! #  This has been tested on AIX 3.1.5.
  2648.   #
  2649.   
  2650.   # use O=-O (usual) or O=-g (debugging)
  2651. --- 5,11 ----
  2652.   #  old make program (I recommend that you get and port the new make if you
  2653.   #  are going to be doing any signficant work on sendmail).
  2654.   #
  2655. ! #  This has been tested on AIX 3.1.5 and 3.2.3e.
  2656.   #
  2657.   
  2658.   # use O=-O (usual) or O=-g (debugging)
  2659. ***************
  2660. *** 19,24 ****
  2661. --- 19,27 ----
  2662.   # See READ_ME for a description of how these flags interact.
  2663.   #
  2664.   DBMDEF=    -DNDBM -DNEWDB
  2665. + #
  2666. + #  If you did not install the NEWDB on your AIX platform, use:
  2667. + #DBMDEF=-DNDBM
  2668.   
  2669.   # environment definitions (e.g., -D_AIX3)
  2670.   ENVDEF=    -D_AIX3
  2671. ***************
  2672. *** 33,38 ****
  2673. --- 36,44 ----
  2674.   
  2675.   # libraries required on your system
  2676.   LIBS=    -ldbm -ldb
  2677. + #
  2678. + #  If you did not install the NEWDB on your AIX platform, use:
  2679. + #LIBS=    -ldbm
  2680.   
  2681.   # location of sendmail binary (usually /usr/sbin or /usr/lib)
  2682.   BINDIR=    ${DESTDIR}/usr/sbin
  2683. ***************
  2684. *** 41,51 ****
  2685.   STDIR=    ${DESTDIR}/var/log
  2686.   
  2687.   # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  2688. ! HFDIR=    ${DESTDIR}/usr/share/misc
  2689.   
  2690.   # additional .o files needed
  2691.   OBJADD=
  2692.   
  2693.   ###################  end of user configuration flags  ######################
  2694.   
  2695.   CFLAGS=    -I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
  2696. --- 47,59 ----
  2697.   STDIR=    ${DESTDIR}/var/log
  2698.   
  2699.   # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  2700. ! HFDIR=    ${DESTDIR}/usr/lib
  2701.   
  2702.   # additional .o files needed
  2703.   OBJADD=
  2704.   
  2705. + INSTALL=/usr/ucb/install
  2706.   ###################  end of user configuration flags  ######################
  2707.   
  2708.   CFLAGS=    -I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
  2709. ***************
  2710. *** 80,90 ****
  2711.   install: install-sendmail install-docs
  2712.   
  2713.   install-sendmail: sendmail
  2714. !     install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  2715.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  2716. !     install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  2717.           ${STDIR}/sendmail.st
  2718. !     install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  2719.   
  2720.   # doesn't actually install them -- you may want to install pre-nroff versions
  2721.   install-docs: aliases.0 newaliases.0 sendmail.0
  2722. --- 88,98 ----
  2723.   install: install-sendmail install-docs
  2724.   
  2725.   install-sendmail: sendmail
  2726. !     ${INSTALL} -O ${BINOWN} -G ${BINGRP} -M ${BINMODE} sendmail ${BINDIR}
  2727.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  2728. !     ${INSTALL} -c -O ${BINOWN} -G ${BINGRP} -M 644 /dev/null \
  2729.           ${STDIR}/sendmail.st
  2730. !     ${INSTALL} -c -O ${BINOWN} -G ${BINGRP} -M 444 sendmail.hf ${HFDIR}
  2731.   
  2732.   # doesn't actually install them -- you may want to install pre-nroff versions
  2733.   install-docs: aliases.0 newaliases.0 sendmail.0
  2734. *** src/Makefile.AUX.OLD    Sat Dec 18 11:20:32 1993
  2735. --- src/Makefile.AUX    Sat Dec 18 11:21:12 1993
  2736. ***************
  2737. *** 85,91 ****
  2738.   install-sendmail: sendmail
  2739.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  2740.       for i in ${LINKS}; do ; rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  2741. !     install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  2742.           ${STDIR}/sendmail.st
  2743.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  2744.   
  2745. --- 85,91 ----
  2746.   install-sendmail: sendmail
  2747.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  2748.       for i in ${LINKS}; do ; rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  2749. !     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  2750.           ${STDIR}/sendmail.st
  2751.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  2752.   
  2753. *** src/Makefile.BSD43.OLD    Fri Nov 12 06:21:16 1993
  2754. --- src/Makefile.BSD43    Sat Dec 18 11:21:16 1993
  2755. ***************
  2756. *** 33,39 ****
  2757.   #LIBDIRS=-L/usr/sww/lib
  2758.   
  2759.   # libraries required on your system
  2760. ! LIBS=    -ldbm -lresolv
  2761.   
  2762.   # location of sendmail binary (usually /usr/sbin or /usr/lib)
  2763.   BINDIR=    ${DESTDIR}/usr/lib
  2764. --- 33,39 ----
  2765.   #LIBDIRS=-L/usr/sww/lib
  2766.   
  2767.   # libraries required on your system
  2768. ! LIBS=    -ldbm -lresolv -ll
  2769.   
  2770.   # location of sendmail binary (usually /usr/sbin or /usr/lib)
  2771.   BINDIR=    ${DESTDIR}/usr/lib
  2772. ***************
  2773. *** 48,54 ****
  2774.   OBJADD=
  2775.   
  2776.   # additional pseudo-sources needed
  2777. ! BEFORE=    unistd.h stddef.h stdlib.h
  2778.   
  2779.   ###################  end of user configuration flags  ######################
  2780.   
  2781. --- 48,54 ----
  2782.   OBJADD=
  2783.   
  2784.   # additional pseudo-sources needed
  2785. ! BEFORE=    unistd.h stddef.h stdlib.h dirent.h sys/time.h
  2786.   
  2787.   ###################  end of user configuration flags  ######################
  2788.   
  2789. ***************
  2790. *** 72,80 ****
  2791.   sendmail: ${BEFORE} ${OBJS}
  2792.       ${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
  2793.   
  2794. ! unistd.h stddef.h stdlib.h:
  2795.       cp /dev/null $@
  2796.   
  2797.   aliases.0: aliases.5
  2798.       nroff -h -mandoc aliases.5 > aliases.0
  2799.   
  2800. --- 72,89 ----
  2801.   sendmail: ${BEFORE} ${OBJS}
  2802.       ${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
  2803.   
  2804. ! unistd.h stddef.h stdlib.h sys/time.h:
  2805.       cp /dev/null $@
  2806.   
  2807. + sys/time.h: sys
  2808. + sys:
  2809. +     mkdir sys
  2810. + dirent.h:
  2811. +     echo "#include <sys/dir.h>" > dirent.h
  2812. +     echo "#define dirent    direct" >> dirent.h
  2813.   aliases.0: aliases.5
  2814.       nroff -h -mandoc aliases.5 > aliases.0
  2815.   
  2816. ***************
  2817. *** 89,95 ****
  2818.   install-sendmail: sendmail
  2819.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  2820.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  2821. !     install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  2822.           ${STDIR}/sendmail.st
  2823.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  2824.   
  2825. --- 98,104 ----
  2826.   install-sendmail: sendmail
  2827.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  2828.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  2829. !     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  2830.           ${STDIR}/sendmail.st
  2831.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  2832.   
  2833. *** src/Makefile.BSDI.OLD    Sat Dec 18 11:20:32 1993
  2834. --- src/Makefile.BSDI    Sat Dec 18 11:21:18 1993
  2835. ***************
  2836. *** 82,88 ****
  2837.   install-sendmail: sendmail
  2838.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  2839.       for i in ${LINKS}; do (rm -f $$i; ln -s ${BINDIR}/sendmail $$i); done
  2840. !     install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  2841.           ${STDIR}/sendmail.st
  2842.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  2843.   
  2844. --- 82,88 ----
  2845.   install-sendmail: sendmail
  2846.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  2847.       for i in ${LINKS}; do (rm -f $$i; ln -s ${BINDIR}/sendmail $$i); done
  2848. !     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  2849.           ${STDIR}/sendmail.st
  2850.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  2851.   
  2852. *** src/Makefile.ConvexOS.OLD    Sat Dec 18 11:20:32 1993
  2853. --- src/Makefile.ConvexOS    Sat Dec 18 11:21:21 1993
  2854. ***************
  2855. *** 83,89 ****
  2856.   install-sendmail: sendmail
  2857.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  2858.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  2859. !     install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  2860.           ${STDIR}/sendmail.st
  2861.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  2862.   
  2863. --- 83,89 ----
  2864.   install-sendmail: sendmail
  2865.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  2866.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  2867. !     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  2868.           ${STDIR}/sendmail.st
  2869.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  2870.   
  2871. *** src/Makefile.DGUX.OLD    Sat Nov 27 09:28:17 1993
  2872. --- src/Makefile.DGUX    Sat Dec 18 11:21:23 1993
  2873. ***************
  2874. *** 0 ****
  2875. --- 1,94 ----
  2876. + #
  2877. + #  Tested on DG/UX 5.4.2 by A. Bryan Curnutt <bryan@Stoner.COM>.
  2878. + #
  2879. + # use O=-O (usual) or O=-g (debugging)
  2880. + O=    -O
  2881. + # define the database mechanisms available for map & alias lookups:
  2882. + #    -DNDBM -- use new DBM
  2883. + #    -DNEWDB -- use new Berkeley DB
  2884. + #    -DNIS -- include NIS support
  2885. + # The really old (V7) DBM library is no longer supported.
  2886. + # See READ_ME for a description of how these flags interact.
  2887. + #
  2888. + DBMDEF=    -DNDBM -DNIS
  2889. + # environment definitions (e.g., -D_AIX3)
  2890. + ENVDEF=-DDGUX
  2891. + # see also conf.h for additional compilation flags
  2892. + # include directories
  2893. + INCDIRS=-I/usr/sww/include/db
  2894. + # loader options
  2895. + LDOPTS=
  2896. + # library directories
  2897. + LIBDIRS=-L/usr/sww/lib
  2898. + # libraries required on your system
  2899. + LIBS=    -ldbm
  2900. + # location of sendmail binary (usually /usr/sbin or /usr/lib)
  2901. + BINDIR=    ${DESTDIR}/usr/bin
  2902. + # location of sendmail.st file (usually /var/log or /usr/lib)
  2903. + STDIR=    ${DESTDIR}/usr/lib
  2904. + # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  2905. + HFDIR=    ${DESTDIR}/etc
  2906. + # additional .o files needed
  2907. + OBJADD=
  2908. + ###################  end of user configuration flags  ######################
  2909. + CFLAGS=    -I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
  2910. + OBJS=    alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  2911. +     deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  2912. +     map.o mci.o parseaddr.o queue.o readcf.o recipient.o \
  2913. +     savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  2914. +     trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  2915. + LINKS=    ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
  2916. + BINOWN=    root
  2917. + BINGRP=    bin
  2918. + BINMODE=6555
  2919. + ALL=    sendmail aliases.0 newaliases.0 sendmail.0
  2920. + all: ${ALL}
  2921. + sendmail: ${BEFORE} ${OBJS}
  2922. +     ${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
  2923. + aliases.0: aliases.5
  2924. +     nroff -h -mandoc aliases.5 > aliases.0
  2925. + newaliases.0: newaliases.1
  2926. +     nroff -h -mandoc newaliases.1 > newaliases.0
  2927. + sendmail.0: sendmail.8
  2928. +     nroff -h -mandoc sendmail.8 > sendmail.0
  2929. + install: install-sendmail install-docs
  2930. + install-sendmail: sendmail
  2931. +     install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  2932. +     for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  2933. +     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  2934. +         ${STDIR}/sendmail.st
  2935. +     install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  2936. + # doesn't actually install them -- you may want to install pre-nroff versions
  2937. + install-docs: aliases.0 newaliases.0 sendmail.0
  2938. + clean:
  2939. +     rm -f ${OBJS} sendmail aliases.0 newaliases.0 sendmail.0
  2940. + # dependencies
  2941. + #   gross overkill, and yet still not quite enough....
  2942. + ${OBJS}: sendmail.h conf.h
  2943. *** src/Makefile.Dell.OLD    Sat Dec 18 05:08:30 1993
  2944. --- src/Makefile.Dell    Wed Dec 22 04:39:02 1993
  2945. ***************
  2946. *** 10,20 ****
  2947.   #    work on other SVR4 ports.
  2948.   #
  2949.   
  2950.   # use O=-O (usual) or O=-g (debugging)
  2951. ! O=    -O
  2952.   
  2953.   CC=    gcc
  2954. ! DESTDIR=/usr/local/sendmail
  2955.   
  2956.   # define the database mechanism used for alias lookups:
  2957.   #    -DNDBM -- use new DBM
  2958. --- 10,23 ----
  2959.   #    work on other SVR4 ports.
  2960.   #
  2961.   
  2962. + # make sure the shell constructs below use the right shell
  2963. + SHELL=    /bin/sh
  2964.   # use O=-O (usual) or O=-g (debugging)
  2965. ! O=    -O2
  2966.   
  2967.   CC=    gcc
  2968. ! #DESTDIR=/usr/local/sendmail
  2969.   
  2970.   # define the database mechanism used for alias lookups:
  2971.   #    -DNDBM -- use new DBM
  2972. ***************
  2973. *** 26,32 ****
  2974.   DBMDEF=    -DNEWDB -DNDBM
  2975.   
  2976.   # environment definitions (e.g., -D_AIX3)
  2977. ! ENVDEF=    -DDELL_SVR4
  2978.   
  2979.   # see also conf.h for additional compilation flags
  2980.   
  2981. --- 29,35 ----
  2982.   DBMDEF=    -DNEWDB -DNDBM
  2983.   
  2984.   # environment definitions (e.g., -D_AIX3)
  2985. ! ENVDEF=    -D__svr4__
  2986.   
  2987.   # see also conf.h for additional compilation flags
  2988.   
  2989. ***************
  2990. *** 40,52 ****
  2991.   LIBS=    -ldb -ldbm -lresolv -lsocket -lnsl -lelf
  2992.   
  2993.   # location of sendmail binary (usually /usr/sbin or /usr/lib)
  2994. ! BINDIR=    ${DESTDIR}/bin
  2995.   
  2996.   # location of sendmail.st file (usually /var/log or /usr/lib)
  2997. ! STDIR=    ${DESTDIR}/etc
  2998.   
  2999.   # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  3000. ! HFDIR=    ${DESTDIR}/etc
  3001.   
  3002.   # additional .o files needed
  3003.   OBJADD=
  3004. --- 43,55 ----
  3005.   LIBS=    -ldb -ldbm -lresolv -lsocket -lnsl -lelf
  3006.   
  3007.   # location of sendmail binary (usually /usr/sbin or /usr/lib)
  3008. ! BINDIR=    ${DESTDIR}/usr/ucblib
  3009.   
  3010.   # location of sendmail.st file (usually /var/log or /usr/lib)
  3011. ! STDIR=    ${DESTDIR}/usr/ucblib
  3012.   
  3013.   # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  3014. ! HFDIR=    ${DESTDIR}/usr/ucblib
  3015.   
  3016.   # additional .o files needed
  3017.   OBJADD=
  3018. ***************
  3019. *** 63,69 ****
  3020.   
  3021.   LINKS=    ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
  3022.   BINOWN=    root
  3023. ! BINGRP=    sys
  3024.   BINMODE=6555
  3025.   INSTALL=/usr/ucb/install
  3026.   
  3027. --- 66,72 ----
  3028.   
  3029.   LINKS=    ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
  3030.   BINOWN=    root
  3031. ! BINGRP=    mail
  3032.   BINMODE=6555
  3033.   INSTALL=/usr/ucb/install
  3034.   
  3035. ***************
  3036. *** 88,94 ****
  3037.   install-sendmail: sendmail
  3038.       ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3039.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3040. !     ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  3041.           ${STDIR}/sendmail.st
  3042.       ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3043.   
  3044. --- 91,97 ----
  3045.   install-sendmail: sendmail
  3046.       ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3047.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3048. !     ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  3049.           ${STDIR}/sendmail.st
  3050.       ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3051.   
  3052. *** src/Makefile.Dynix.OLD    Sat Nov 27 14:23:38 1993
  3053. --- src/Makefile.Dynix    Sat Dec 18 11:21:27 1993
  3054. ***************
  3055. *** 0 ****
  3056. --- 1,106 ----
  3057. + #
  3058. + #  Tested on Dynix 3.2.0.
  3059. + #
  3060. + #    From Jim Davis <jdavis@cs.arizona.edu>.
  3061. + #
  3062. + #     ``There is no strtol in libc (well there is in the 'att universe'
  3063. + #    libc, but I couldn't figure out how to link that in), so I
  3064. + #    got the Chris Torek strtol.c from bsd-sources on uunet and
  3065. + #    compiled that.  There is no native ndbm either; I couldn't
  3066. + #    get db 1.72 to pass it's regression test, so I used gdbm-1.7
  3067. + #    instead.  I compiled it with gcc 1.40a.  The -lseq is to pick
  3068. + #    up getopt.''
  3069. + #
  3070. + CC= gcc
  3071. + # use O=-O (usual) or O=-g (debugging)
  3072. + O=    -O -g
  3073. + # define the database mechanisms available for map & alias lookups:
  3074. + #    -DNDBM -- use new DBM
  3075. + #    -DNEWDB -- use new Berkeley DB
  3076. + #    -DNIS -- include NIS support
  3077. + # The really old (V7) DBM library is no longer supported.
  3078. + # See READ_ME for a description of how these flags interact.
  3079. + #
  3080. + DBMDEF=    -DNDBM
  3081. + # environment definitions (e.g., -D_AIX3)
  3082. + ENVDEF=
  3083. + # see also conf.h for additional compilation flags
  3084. + # include directories
  3085. + INCDIRS=
  3086. + # loader options
  3087. + LDOPTS=
  3088. + # library directories
  3089. + LIBDIRS=
  3090. + # libraries required on your system
  3091. + LIBS=    -lseq -lgdbm
  3092. + # location of sendmail binary (usually /usr/sbin or /usr/lib)
  3093. + BINDIR=    ${DESTDIR}/usr/lib
  3094. + # location of sendmail.st file (usually /var/log or /usr/lib)
  3095. + STDIR=    ${DESTDIR}/usr/lib
  3096. + # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  3097. + HFDIR=    ${DESTDIR}/usr/lib
  3098. + # additional .o files needed
  3099. + OBJADD=strtol.o
  3100. + ###################  end of user configuration flags  ######################
  3101. + CFLAGS=    -I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
  3102. + OBJS=    alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  3103. +     deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  3104. +     map.o mci.o parseaddr.o queue.o readcf.o recipient.o \
  3105. +     savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  3106. +     trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  3107. + LINKS=    ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
  3108. + BINOWN=    root
  3109. + BINGRP=    staff # no kmem group,
  3110. + BINMODE=4555  # so not setgid
  3111. + ALL=    sendmail aliases.0 newaliases.0 sendmail.0
  3112. + all: ${ALL}
  3113. + sendmail: ${BEFORE} ${OBJS}
  3114. +     ${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
  3115. + aliases.0: aliases.5
  3116. +     nroff -h -mandoc aliases.5 > aliases.0
  3117. + newaliases.0: newaliases.1
  3118. +     nroff -h -mandoc newaliases.1 > newaliases.0
  3119. + sendmail.0: sendmail.8
  3120. +     nroff -h -mandoc sendmail.8 > sendmail.0
  3121. + install: install-sendmail install-docs
  3122. + install-sendmail: sendmail
  3123. +     install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3124. +     for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3125. +     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  3126. +         ${STDIR}/sendmail.st
  3127. +     install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3128. + # doesn't actually install them -- you may want to install pre-nroff versions
  3129. + install-docs: aliases.0 newaliases.0 sendmail.0
  3130. + clean:
  3131. +     rm -f ${OBJS} sendmail aliases.0 newaliases.0 sendmail.0
  3132. + # dependencies
  3133. + #   gross overkill, and yet still not quite enough....
  3134. + ${OBJS}: sendmail.h conf.h
  3135. *** src/Makefile.FreeBSD.OLD    Wed Dec  1 09:21:27 1993
  3136. --- src/Makefile.FreeBSD    Sat Dec 18 11:21:31 1993
  3137. ***************
  3138. *** 0 ****
  3139. --- 1,49 ----
  3140. + #
  3141. + #  Makefile for FreeBSD
  3142. + #
  3143. + #    @(#)Makefile    8.2 (Berkeley) 8/15/93
  3144. + PROG=    sendmail
  3145. + # define the database format to use for aliases et al.  Can be -DNEWDB (for
  3146. + # the new BSD database package -- this is preferred) or -DNDBM for the NDBM
  3147. + # database package.  The old putrescent V7 DBM package is no longer
  3148. + # supported.
  3149. + # You can define both NEWDB and NDBM during a transition period; old
  3150. + # databases are read, but the new format will be used on any rebuilds.  On
  3151. + # really gnarly systems, you can set this to null; it will crawl like a high
  3152. + # spiral snail, but it will work.
  3153. + DBMDEF=    -DNEWDB
  3154. + # FreeBSD 1.0 RELEASE has uname(2) now. Use -DUSEUNAME in order to use it.
  3155. + CFLAGS+=-I${.CURDIR} ${DBMDEF} -DMIME -DUSEUNAME
  3156. + SRCS=    alias.c arpadate.c clock.c collect.c conf.c convtime.c daemon.c \
  3157. +     deliver.c domain.c envelope.c err.c headers.c macro.c main.c map.c \
  3158. +     mci.c parseaddr.c queue.c readcf.c recipient.c savemail.c srvrsmtp.c \
  3159. +     stab.c stats.c sysexits.c trace.c udb.c usersmtp.c \
  3160. +     util.c version.c
  3161. + DPADD=    
  3162. + LDADD=    $(LIBUTIL)
  3163. + #
  3164. + # FreeBSD 1.0 RELEASE has GNU man and doesn't need preformatted man pages anymore
  3165. + #
  3166. + MAN1=    newaliases.1
  3167. + MAN5=    aliases.5
  3168. + MAN8=    sendmail.8 
  3169. + LINKS=    /usr/sbin/sendmail /usr/bin/newaliases \
  3170. +     /usr/sbin/sendmail /usr/bin/mailq
  3171. + BINDIR=    /usr/sbin
  3172. + BINOWN=    root
  3173. + BINGRP=    kmem
  3174. + BINMODE=6555
  3175. + beforeinstall:
  3176. + #    install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  3177. + #        ${DESTDIR}/etc/sendmail.fc
  3178. +     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  3179. +         ${DESTDIR}/var/log/sendmail.st
  3180. +     install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/sendmail.hf \
  3181. +         ${DESTDIR}/usr/share/misc
  3182. + .include <bsd.prog.mk>
  3183. *** src/Makefile.HP-UX.OLD    Sat Dec 18 11:20:33 1993
  3184. --- src/Makefile.HP-UX    Tue Jan  4 08:00:44 1994
  3185. ***************
  3186. *** 39,45 ****
  3187.   BINDIR=    ${DESTDIR}/usr/lib
  3188.   
  3189.   # location of sendmail.st file (usually /var/log or /usr/lib)
  3190. ! STDIR=    ${DESTDIR}/var/log
  3191.   
  3192.   # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  3193.   HFDIR=    ${DESTDIR}/usr/lib
  3194. --- 39,45 ----
  3195.   BINDIR=    ${DESTDIR}/usr/lib
  3196.   
  3197.   # location of sendmail.st file (usually /var/log or /usr/lib)
  3198. ! STDIR=    ${DESTDIR}/usr/lib
  3199.   
  3200.   # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  3201.   HFDIR=    ${DESTDIR}/usr/lib
  3202. ***************
  3203. *** 58,66 ****
  3204.       savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  3205.       trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  3206.   
  3207. ! LINKS=    ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
  3208.   BINOWN=    root
  3209. ! BINGRP=    sys
  3210.   BINMODE=6555
  3211.   
  3212.   ALL=    sendmail aliases.0 newaliases.0 sendmail.0
  3213. --- 58,66 ----
  3214.       savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  3215.       trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  3216.   
  3217. ! LINKS=    ${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq
  3218.   BINOWN=    root
  3219. ! BINGRP=    mail
  3220.   BINMODE=6555
  3221.   
  3222.   ALL=    sendmail aliases.0 newaliases.0 sendmail.0
  3223. ***************
  3224. *** 82,92 ****
  3225.   install: install-sendmail install-docs
  3226.   
  3227.   install-sendmail: sendmail
  3228. !     install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3229.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3230. !     install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  3231. !         ${STDIR}/sendmail.st
  3232. !     install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3233.   
  3234.   # doesn't actually install them -- you may want to install pre-nroff versions
  3235.   install-docs: aliases.0 newaliases.0 sendmail.0
  3236. --- 82,91 ----
  3237.   install: install-sendmail install-docs
  3238.   
  3239.   install-sendmail: sendmail
  3240. !     cpset sendmail ${BINDIR} ${BINMODE} ${BINOWN} ${BINGRP}
  3241.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3242. !     cpset /dev/null ${STDIR}/sendmail.st 644 ${BINOWN} ${BINGRP}
  3243. !     cpset sendmail.hf ${HFDIR} 444 ${BINOWN} ${BINGRP}
  3244.   
  3245.   # doesn't actually install them -- you may want to install pre-nroff versions
  3246.   install-docs: aliases.0 newaliases.0 sendmail.0
  3247. *** src/Makefile.IRIX.OLD    Sat Dec 18 11:20:33 1993
  3248. --- src/Makefile.IRIX    Sat Dec 18 11:21:35 1993
  3249. ***************
  3250. *** 83,89 ****
  3251.   install-sendmail: sendmail
  3252.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3253.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3254. !     install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  3255.           ${STDIR}/sendmail.st
  3256.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3257.   
  3258. --- 83,89 ----
  3259.   install-sendmail: sendmail
  3260.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3261.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3262. !     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  3263.           ${STDIR}/sendmail.st
  3264.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3265.   
  3266. *** src/Makefile.Linux.OLD    Thu Dec  9 13:44:34 1993
  3267. --- src/Makefile.Linux    Mon Dec 20 05:53:18 1993
  3268. ***************
  3269. *** 21,27 ****
  3270.   DBMDEF=    -DNDBM
  3271.   
  3272.   # environment definitions (e.g., -D_AIX3)
  3273. ! ENVDEF=    -D__USE_BSD -U__USE_POSIX2
  3274.   
  3275.   # see also conf.h for additional compilation flags
  3276.   
  3277. --- 21,27 ----
  3278.   DBMDEF=    -DNDBM
  3279.   
  3280.   # environment definitions (e.g., -D_AIX3)
  3281. ! ENVDEF=    -D__USE_BSD
  3282.   
  3283.   # see also conf.h for additional compilation flags
  3284.   
  3285. ***************
  3286. *** 47,53 ****
  3287.   OBJADD=
  3288.   
  3289.   # additional pseudo-sources needed
  3290. ! BEFORE=
  3291.   
  3292.   ###################  end of user configuration flags  ######################
  3293.   
  3294. --- 47,53 ----
  3295.   OBJADD=
  3296.   
  3297.   # additional pseudo-sources needed
  3298. ! BEFORE=    features.h
  3299.   
  3300.   ###################  end of user configuration flags  ######################
  3301.   
  3302. ***************
  3303. *** 59,65 ****
  3304.       savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  3305.       trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  3306.   
  3307. ! LINKS=    ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
  3308.   BINOWN=    root
  3309.   BINGRP=    kmem
  3310.   BINMODE=6555
  3311. --- 59,65 ----
  3312.       savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  3313.       trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  3314.   
  3315. ! LINKS=    ${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq
  3316.   BINOWN=    root
  3317.   BINGRP=    kmem
  3318.   BINMODE=6555
  3319. ***************
  3320. *** 78,83 ****
  3321. --- 78,86 ----
  3322.       echo "#include <sys/dir.h>" > dirent.h
  3323.       echo "#define dirent    direct" >> dirent.h
  3324.   
  3325. + features.h:
  3326. +     ln features.linux.h $@
  3327.   NROFF=    nroff
  3328.   
  3329.   aliases.0: aliases.5
  3330. ***************
  3331. *** 94,100 ****
  3332.   install-sendmail: sendmail
  3333.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3334.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3335. !     install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  3336.           ${STDIR}/sendmail.st
  3337.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3338.   
  3339. --- 97,103 ----
  3340.   install-sendmail: sendmail
  3341.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3342.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3343. !     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  3344.           ${STDIR}/sendmail.st
  3345.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3346.   
  3347. *** src/Makefile.Mach386.OLD    Wed Dec  1 09:21:19 1993
  3348. --- src/Makefile.Mach386    Sat Dec 18 11:21:41 1993
  3349. ***************
  3350. *** 0 ****
  3351. --- 1,102 ----
  3352. + #
  3353. + #  This Makefile is designed to work on the old "make" program.  It does
  3354. + #  not use the obj subdirectory.  It also does not install documentation
  3355. + #  automatically -- think of it as a quick start for sites that have the
  3356. + #  old make program (I recommend that you get and port the new make if you
  3357. + #  are going to be doing any signficant work on sendmail).
  3358. + #
  3359. + #    @(#)Makefile.dist    8.7 (Berkeley) 9/3/93
  3360. + #
  3361. + CC=    gcc
  3362. + # use O=-O (usual) or O=-g (debugging)
  3363. + O=    -O
  3364. + # define the database mechanisms available for map & alias lookups:
  3365. + #    -DNDBM -- use new DBM
  3366. + #    -DNEWDB -- use new Berkeley DB
  3367. + #    -DNIS -- include NIS support
  3368. + # The really old (V7) DBM library is no longer supported.
  3369. + # See READ_ME for a description of how these flags interact.
  3370. + #
  3371. + DBMDEF=    -DNDBM
  3372. + # environment definitions (e.g., -D_AIX3)
  3373. + ENVDEF=
  3374. + # see also conf.h for additional compilation flags
  3375. + # include directories
  3376. + INCDIRS=
  3377. + # loader options
  3378. + LDOPTS=
  3379. + # library directories
  3380. + LIBDIRS=
  3381. + # libraries required on your system
  3382. + LIBS=    -ldbm
  3383. + # location of sendmail binary (usually /usr/sbin or /usr/lib)
  3384. + BINDIR=    ${DESTDIR}/usr/lib
  3385. + # location of sendmail.st file (usually /var/log or /usr/lib)
  3386. + STDIR=    ${DESTDIR}/usr/lib
  3387. + # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  3388. + HFDIR=    ${DESTDIR}/usr/lib
  3389. + # additional .o files needed
  3390. + OBJADD=
  3391. + ###################  end of user configuration flags  ######################
  3392. + CFLAGS=    -I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
  3393. + OBJS=    alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  3394. +     deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  3395. +     map.o mci.o parseaddr.o queue.o readcf.o recipient.o \
  3396. +     savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  3397. +     trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  3398. + LINKS=    ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
  3399. + BINOWN=    root
  3400. + BINGRP=    kmem
  3401. + BINMODE=6555
  3402. + ALL=    sendmail aliases.0 newaliases.0 sendmail.0
  3403. + all: ${ALL}
  3404. + sendmail: ${BEFORE} ${OBJS}
  3405. +     ${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
  3406. + aliases.0: aliases.5
  3407. +     nroff -h -mandoc aliases.5 > aliases.0
  3408. + newaliases.0: newaliases.1
  3409. +     nroff -h -mandoc newaliases.1 > newaliases.0
  3410. + sendmail.0: sendmail.8
  3411. +     nroff -h -mandoc sendmail.8 > sendmail.0
  3412. + install: install-sendmail install-docs
  3413. + install-sendmail: sendmail
  3414. +     install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3415. +     for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3416. +     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  3417. +         ${STDIR}/sendmail.st
  3418. +     install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3419. + # doesn't actually install them -- you may want to install pre-nroff versions
  3420. + install-docs: aliases.0 newaliases.0 sendmail.0
  3421. + clean:
  3422. +     rm -f ${OBJS} sendmail aliases.0 newaliases.0 sendmail.0
  3423. + # dependencies
  3424. + #   gross overkill, and yet still not quite enough....
  3425. + ${OBJS}: sendmail.h conf.h
  3426. *** src/Makefile.NeXT.OLD    Sat Dec 18 11:20:33 1993
  3427. --- src/Makefile.NeXT    Sun Dec 26 07:56:13 1993
  3428. ***************
  3429. *** 21,27 ****
  3430.   DBMDEF=    -DNDBM
  3431.   
  3432.   # environment definitions (e.g., -D_AIX3)
  3433. ! ENVDEF=    -DNeXT
  3434.   
  3435.   # see also conf.h for additional compilation flags
  3436.   
  3437. --- 21,27 ----
  3438.   DBMDEF=    -DNDBM
  3439.   
  3440.   # environment definitions (e.g., -D_AIX3)
  3441. ! ENVDEF=    -DNeXT -DNETINFO
  3442.   
  3443.   # see also conf.h for additional compilation flags
  3444.   
  3445. ***************
  3446. *** 92,98 ****
  3447.   install-sendmail: sendmail
  3448.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3449.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3450. !     install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  3451.           ${STDIR}/sendmail.st
  3452.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3453.   
  3454. --- 92,98 ----
  3455.   install-sendmail: sendmail
  3456.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3457.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3458. !     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  3459.           ${STDIR}/sendmail.st
  3460.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3461.   
  3462. *** src/Makefile.NetBSD.OLD    Fri Dec 10 06:25:31 1993
  3463. --- src/Makefile.NetBSD    Mon Jan 10 07:29:03 1994
  3464. ***************
  3465. *** 0 ****
  3466. --- 1,48 ----
  3467. + #
  3468. + #  NetBSD Makefile
  3469. + #
  3470. + #    @(#)Makefile    8.2 (Berkeley) 8/15/93
  3471. + PROG=    sendmail
  3472. + # define the database format to use for aliases et al.  Can be -DNEWDB (for
  3473. + # the new BSD database package -- this is preferred) or -DNDBM for the NDBM
  3474. + # database package.  The old putrescent V7 DBM package is no longer
  3475. + # supported.
  3476. + # You can define both NEWDB and NDBM during a transition period; old
  3477. + # databases are read, but the new format will be used on any rebuilds.  On
  3478. + # really gnarly systems, you can set this to null; it will crawl like a high
  3479. + # spiral snail, but it will work.
  3480. + DBMDEF=    -DNEWDB -DNDBM
  3481. + #nasty warning about gcc 2.4.x caused bugs 
  3482. + CFLAGS=-I${.CURDIR} ${DBMDEF} -DNETISO
  3483. + #CFLAGS+=-I${.CURDIR} ${DBMDEF} -DNETISO
  3484. + SRCS=    alias.c arpadate.c clock.c collect.c conf.c convtime.c daemon.c \
  3485. +     deliver.c domain.c envelope.c err.c headers.c macro.c main.c map.c \
  3486. +     mci.c parseaddr.c queue.c readcf.c recipient.c savemail.c srvrsmtp.c \
  3487. +     stab.c stats.c sysexits.c trace.c udb.c usersmtp.c \
  3488. +     util.c version.c
  3489. + DPADD=    $(LIBUTIL)
  3490. + LDADD=    -lutil
  3491. + MAN1=    newaliases.0
  3492. + MAN5=    aliases.0
  3493. + MAN8=    sendmail.0 
  3494. + LINKS=    /usr/sbin/sendmail /usr/bin/newaliases \
  3495. +     /usr/sbin/sendmail /usr/bin/mailq
  3496. + BINDIR=    /usr/sbin
  3497. + BINOWN=    root
  3498. + BINGRP=    kmem
  3499. + BINMODE=6555
  3500. + beforeinstall:
  3501. + #    install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  3502. + #        ${DESTDIR}/etc/sendmail.fc
  3503. +     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  3504. +         ${DESTDIR}/var/log/sendmail.st
  3505. +     install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/sendmail.hf \
  3506. +         ${DESTDIR}/usr/share/misc
  3507. + .include <bsd.prog.mk>
  3508. *** src/Makefile.OSF1.OLD    Sun Nov  7 10:38:01 1993
  3509. --- src/Makefile.OSF1    Sat Dec 18 11:22:23 1993
  3510. ***************
  3511. *** 29,35 ****
  3512.   INCDIRS=-I/usr/sww/include/db
  3513.   
  3514.   # library directories
  3515. ! LIBDIRS=-L/usr/sww/lib
  3516.   
  3517.   # libraries required on your system
  3518.   LIBS=    -ldbm
  3519. --- 29,35 ----
  3520.   INCDIRS=-I/usr/sww/include/db
  3521.   
  3522.   # library directories
  3523. ! LIBDIRS=-L/usr/sww/lib -L/usr/shlib -L/usr/lib
  3524.   
  3525.   # libraries required on your system
  3526.   LIBS=    -ldbm
  3527. ***************
  3528. *** 47,53 ****
  3529.   OBJADD=
  3530.   
  3531.   # additional link flags
  3532. ! LDADD=    -non_shared
  3533.   
  3534.   ###################  end of user configuration flags  ######################
  3535.   
  3536. --- 47,53 ----
  3537.   OBJADD=
  3538.   
  3539.   # additional link flags
  3540. ! #LDADD=    -non_shared
  3541.   
  3542.   ###################  end of user configuration flags  ######################
  3543.   
  3544. ***************
  3545. *** 69,75 ****
  3546.   all: ${ALL}
  3547.   
  3548.   sendmail: ${BEFORE} ${OBJS}
  3549. !     ${CC} -o sendmail ${LDFLAGS} ${OBJS} ${LIBDIRS} ${LIBS}
  3550.   
  3551.   aliases.0: aliases.5
  3552.       nroff -h -mandoc aliases.5 > aliases.0
  3553. --- 69,75 ----
  3554.   all: ${ALL}
  3555.   
  3556.   sendmail: ${BEFORE} ${OBJS}
  3557. !     ${CC} -o sendmail ${LDADD} ${OBJS} ${LIBDIRS} ${LIBS}
  3558.   
  3559.   aliases.0: aliases.5
  3560.       nroff -h -mandoc aliases.5 > aliases.0
  3561. ***************
  3562. *** 86,93 ****
  3563.       installbsd -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3564.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3565.       cp /dev/null ${STDIR}/sendmail.st
  3566. !     chmod ${BINMOD} ${STDIR}/sendmail.st
  3567. !     chown ${BINGRP}.${BINGRP} ${STDIR}/sendmail.st
  3568.       installbsd -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3569.       rm -f /usr/sbin/smtpd
  3570.   
  3571. --- 86,93 ----
  3572.       installbsd -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3573.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3574.       cp /dev/null ${STDIR}/sendmail.st
  3575. !     chmod 644 ${STDIR}/sendmail.st
  3576. !     chown ${BINOWN}.${BINGRP} ${STDIR}/sendmail.st
  3577.       installbsd -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3578.       rm -f /usr/sbin/smtpd
  3579.   
  3580. *** src/Makefile.RISCos.OLD    Wed Dec  1 09:08:32 1993
  3581. --- src/Makefile.RISCos    Sat Dec 18 11:22:27 1993
  3582. ***************
  3583. *** 0 ****
  3584. --- 1,110 ----
  3585. + #
  3586. + #  This Makefile is designed to work on the old "make" program.  It does
  3587. + #  not use the obj subdirectory.  It also does not install documentation
  3588. + #  automatically -- think of it as a quick start for sites that have the
  3589. + #  old make program (I recommend that you get and port the new make if you
  3590. + #  are going to be doing any signficant work on sendmail).
  3591. + #
  3592. + #    For Mips RISC/os 4.52.
  3593. + #
  3594. + # use O=-O (usual) or O=-g (debugging)
  3595. + O=    -O
  3596. + # be sure we are compiling in BSD mode
  3597. + CC=    cc -systype bsd43
  3598. + # define the database mechanism used for alias lookups:
  3599. + #    -DNDBM -- use new DBM
  3600. + #    -DNEWDB -- use new Berkeley DB
  3601. + #    -DNIS -- include NIS support
  3602. + # The really old (V7) DBM library is no longer supported.
  3603. + # See READ_ME for a description of how these flags interact.
  3604. + #
  3605. + DBMDEF=    -DNDBM
  3606. + # environment definitions (e.g., -D_AIX3)
  3607. + ENVDEF=    -DRISCOS -Olimit 800
  3608. + # see also conf.h for additional compilation flags
  3609. + # include directories
  3610. + #INCDIRS=-I/usr/sww/include/db
  3611. + # library directories
  3612. + #LIBDIRS=-L/usr/sww/lib
  3613. + # libraries required on your system
  3614. + LIBS=    -lmld
  3615. + # location of sendmail binary (usually /usr/sbin or /usr/lib)
  3616. + BINDIR=    ${DESTDIR}/usr/lib
  3617. + # location of sendmail.st file (usually /var/log or /usr/lib)
  3618. + STDIR=    ${DESTDIR}/etc
  3619. + # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  3620. + HFDIR=    ${DESTDIR}/usr/lib
  3621. + # additional .o files needed
  3622. + OBJADD=
  3623. + # additional pseudo-sources needed
  3624. + BEFORE=    stdlib.h dirent.h
  3625. + ###################  end of user configuration flags  ######################
  3626. + CFLAGS=    -I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
  3627. + OBJS=    alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  3628. +     deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  3629. +     map.o mci.o parseaddr.o queue.o readcf.o recipient.o \
  3630. +     savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  3631. +     trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  3632. + LINKS=    ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
  3633. + BINOWN=    root
  3634. + BINGRP=    kmem
  3635. + BINMODE=6555
  3636. + ALL=    sendmail aliases.0 newaliases.0 sendmail.0
  3637. + all: ${ALL}
  3638. + sendmail: ${BEFORE} ${OBJS}
  3639. +     ${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
  3640. + stdlib.h:
  3641. +     cp /dev/null $@
  3642. + dirent.h:
  3643. +     echo "#include <sys/dir.h>" > dirent.h
  3644. +     echo "#define dirent    direct" >> dirent.h
  3645. + aliases.0: aliases.5
  3646. +     nroff -h -mandoc aliases.5 > aliases.0
  3647. + newaliases.0: newaliases.1
  3648. +     nroff -h -mandoc newaliases.1 > newaliases.0
  3649. + sendmail.0: sendmail.8
  3650. +     nroff -h -mandoc sendmail.8 > sendmail.0
  3651. + install: install-sendmail install-docs
  3652. + install-sendmail: sendmail
  3653. +     install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3654. +     for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3655. +     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  3656. +         ${STDIR}/sendmail.st
  3657. +     install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3658. + # doesn't actually install them -- you may want to install pre-nroff versions
  3659. + install-docs: aliases.0 newaliases.0 sendmail.0
  3660. + clean:
  3661. +     rm -f ${OBJS} sendmail aliases.0 newaliases.0 sendmail.0
  3662. + # dependencies
  3663. + #   gross overkill, and yet still not quite enough....
  3664. + ${OBJS}: sendmail.h conf.h
  3665. *** src/Makefile.SCO.OLD    Sun Dec 12 20:33:12 1993
  3666. --- src/Makefile.SCO    Sat Dec 18 11:22:31 1993
  3667. ***************
  3668. *** 0 ****
  3669. --- 1,97 ----
  3670. + #
  3671. + #  This Makefile is designed to work on the old "make" program.  It does
  3672. + #  not use the obj subdirectory.  It also does not install documentation
  3673. + #  automatically -- think of it as a quick start for sites that have the
  3674. + #  old make program (I recommend that you get and port the new make if you
  3675. + #  are going to be doing any signficant work on sendmail).
  3676. + #
  3677. + #  This has been tested on SCO.
  3678. + #
  3679. + # use O=-O (usual) or O=-g (debugging)
  3680. + O=    -O
  3681. + # define the database mechanisms available for map & alias lookups:
  3682. + #    -DNDBM -- use new DBM
  3683. + #    -DNEWDB -- use new Berkeley DB
  3684. + #    -DNIS -- include NIS support
  3685. + # The really old (V7) DBM library is no longer supported.
  3686. + # See READ_ME for a description of how these flags interact.
  3687. + #
  3688. + DBMDEF=
  3689. + # environment definitions (e.g., -D_AIX3)
  3690. + ENVDEF=    -D_SCO_unix_
  3691. + # see also conf.h for additional compilation flags
  3692. + # include directories
  3693. + INCDIRS=
  3694. + # library directories
  3695. + LIBDIRS=
  3696. + # libraries required on your system
  3697. + LIBS=    -lsocket
  3698. + # location of sendmail binary (usually /usr/sbin or /usr/lib)
  3699. + BINDIR=    ${DESTDIR}/usr/lib
  3700. + # location of sendmail.st file (usually /var/log or /usr/lib)
  3701. + STDIR=    ${DESTDIR}/usr/lib
  3702. + # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  3703. + HFDIR=    ${DESTDIR}/usr/lib
  3704. + # additional .o files needed
  3705. + OBJADD=    fsync.o
  3706. + ###################  end of user configuration flags  ######################
  3707. + CFLAGS=    -I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
  3708. + OBJS=    alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  3709. +     deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  3710. +     map.o mci.o parseaddr.o queue.o readcf.o recipient.o \
  3711. +     savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  3712. +     trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  3713. + LINKS=    ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
  3714. + BINOWN=    root
  3715. + BINGRP=    kmem
  3716. + BINMODE=6555
  3717. + ALL=    sendmail aliases.0 newaliases.0 sendmail.0
  3718. + all: ${ALL}
  3719. + sendmail: ${BEFORE} ${OBJS}
  3720. +     ${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
  3721. + aliases.0: aliases.5
  3722. +     nroff -h -mandoc aliases.5 > aliases.0
  3723. + newaliases.0: newaliases.1
  3724. +     nroff -h -mandoc newaliases.1 > newaliases.0
  3725. + sendmail.0: sendmail.8
  3726. +     nroff -h -mandoc sendmail.8 > sendmail.0
  3727. + install: install-sendmail install-docs
  3728. + install-sendmail: sendmail
  3729. +     install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3730. +     for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3731. +     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  3732. +         ${STDIR}/sendmail.st
  3733. +     install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3734. + # doesn't actually install them -- you may want to install pre-nroff versions
  3735. + install-docs: aliases.0 newaliases.0 sendmail.0
  3736. + clean:
  3737. +     rm -f ${OBJS} sendmail aliases.0 newaliases.0 sendmail.0
  3738. + # dependencies
  3739. + #   gross overkill, and yet still not quite enough....
  3740. + ${OBJS}: sendmail.h conf.h
  3741. *** src/Makefile.SVR4.OLD    Tue Dec 21 06:18:28 1993
  3742. --- src/Makefile.SVR4    Wed Dec 22 04:39:09 1993
  3743. ***************
  3744. *** 0 ****
  3745. --- 1,106 ----
  3746. + #
  3747. + #  This Makefile is designed to work on the old "make" program.  It does
  3748. + #  not use the obj subdirectory.  It also does not install documentation
  3749. + #  automatically -- think of it as a quick start for sites that have the
  3750. + #  old make program (I recommend that you get and port the new make if you
  3751. + #  are going to be doing any signficant work on sendmail).
  3752. + #
  3753. + #    Based on a Makefile for Dell SVR4 Issue 2.2 from Kimmo Suominen
  3754. + #    <kim@grendel.lut.fi> -- I haven't tested this myself.  It may
  3755. + #    work on other SVR4 ports.
  3756. + #
  3757. + # make sure the shell constructs below use the right shell
  3758. + SHELL=    /bin/sh
  3759. + # use O=-O (usual) or O=-g (debugging)
  3760. + O=    -O
  3761. + CC=    gcc
  3762. + #DESTDIR=/usr/local/sendmail
  3763. + # define the database mechanism used for alias lookups:
  3764. + #    -DNDBM -- use new DBM
  3765. + #    -DNEWDB -- use new Berkeley DB
  3766. + #    -DNIS -- include NIS support
  3767. + # The really old (V7) DBM library is no longer supported.
  3768. + # See READ_ME for a description of how these flags interact.
  3769. + #
  3770. + DBMDEF=    -DNEWDB -DNDBM
  3771. + # environment definitions (e.g., -D_AIX3)
  3772. + ENVDEF=    -D__svr4__
  3773. + # see also conf.h for additional compilation flags
  3774. + # include directories
  3775. + INCDIRS=
  3776. + # library directories
  3777. + LIBDIRS=
  3778. + # libraries required on your system
  3779. + LIBS=    -ldb -ldbm -lresolv -lsocket -lnsl -lelf
  3780. + # location of sendmail binary (usually /usr/sbin or /usr/lib)
  3781. + BINDIR=    ${DESTDIR}/usr/ucblib
  3782. + # location of sendmail.st file (usually /var/log or /usr/lib)
  3783. + STDIR=    ${DESTDIR}/usr/ucblib
  3784. + # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  3785. + HFDIR=    ${DESTDIR}/usr/ucblib
  3786. + # additional .o files needed
  3787. + OBJADD=
  3788. + ###################  end of user configuration flags  ######################
  3789. + CFLAGS=    -I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
  3790. + OBJS=    alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  3791. +     deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  3792. +     map.o mci.o parseaddr.o queue.o readcf.o recipient.o \
  3793. +     savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  3794. +     trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  3795. + LINKS=    ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
  3796. + BINOWN=    root
  3797. + BINGRP=    mail
  3798. + BINMODE=6555
  3799. + INSTALL=/usr/ucb/install
  3800. + ALL=    sendmail aliases.0 newaliases.0 sendmail.0
  3801. + all: ${ALL}
  3802. + sendmail: ${BEFORE} ${OBJS}
  3803. +     ${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
  3804. + aliases.0: aliases.5
  3805. +     nroff -h -mandoc aliases.5 > aliases.0
  3806. + newaliases.0: newaliases.1
  3807. +     nroff -h -mandoc newaliases.1 > newaliases.0
  3808. + sendmail.0: sendmail.8
  3809. +     nroff -h -mandoc sendmail.8 > sendmail.0
  3810. + install: install-sendmail install-docs
  3811. + install-sendmail: sendmail
  3812. +     ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3813. +     for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3814. +     ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  3815. +         ${STDIR}/sendmail.st
  3816. +     ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3817. + # doesn't actually install them -- you may want to install pre-nroff versions
  3818. + install-docs: aliases.0 newaliases.0 sendmail.0
  3819. + clean:
  3820. +     rm -f ${OBJS} sendmail aliases.0 newaliases.0 sendmail.0
  3821. + # dependencies
  3822. + #   gross overkill, and yet still not quite enough....
  3823. + ${OBJS}: sendmail.h conf.h
  3824. *** src/Makefile.Solaris.OLD    Sun Nov 14 07:47:59 1993
  3825. --- src/Makefile.Solaris    Tue Dec 28 18:07:03 1993
  3826. ***************
  3827. *** 9,17 ****
  3828.   #
  3829.   
  3830.   # use O=-O (usual) or O=-g (debugging)
  3831. ! O=    -O
  3832.   
  3833. ! CC=    gcc -V2.3.3
  3834.   
  3835.   # define the database mechanism used for alias lookups:
  3836.   #    -DNDBM -- use new DBM
  3837. --- 9,18 ----
  3838.   #
  3839.   
  3840.   # use O=-O (usual) or O=-g (debugging)
  3841. ! # warning: do not use -O with gcc
  3842. ! O=    
  3843.   
  3844. ! CC=    gcc
  3845.   
  3846.   # define the database mechanism used for alias lookups:
  3847.   #    -DNDBM -- use new DBM
  3848. ***************
  3849. *** 20,49 ****
  3850.   # The really old (V7) DBM library is no longer supported.
  3851.   # See READ_ME for a description of how these flags interact.
  3852.   #
  3853. ! DBMDEF=    -DNDBM
  3854.   
  3855.   # environment definitions (e.g., -D_AIX3)
  3856.   ENVDEF=    -DSOLARIS
  3857.   
  3858.   # see also conf.h for additional compilation flags
  3859.   
  3860.   # include directories
  3861. ! INCDIRS=-I/usr/sww/include/db
  3862.   
  3863.   # library directories
  3864. ! LIBDIRS=-L/usr/sww/lib -L/usr/ucblib
  3865.   
  3866.   # libraries required on your system
  3867.   LIBS=    -lresolv -lsocket -lnsl -lelf
  3868.   
  3869.   # location of sendmail binary (usually /usr/sbin or /usr/lib)
  3870. ! BINDIR=    ${DESTDIR}/usr/sbin
  3871.   
  3872.   # location of sendmail.st file (usually /var/log or /usr/lib)
  3873.   STDIR=    ${DESTDIR}/var/log
  3874.   
  3875.   # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  3876. ! HFDIR=    ${DESTDIR}/usr/share/misc
  3877.   
  3878.   # additional .o files needed
  3879.   OBJADD=
  3880. --- 21,51 ----
  3881.   # The really old (V7) DBM library is no longer supported.
  3882.   # See READ_ME for a description of how these flags interact.
  3883.   #
  3884. ! DBMDEF=    -DNDBM -DNIS
  3885.   
  3886.   # environment definitions (e.g., -D_AIX3)
  3887. + # include -DSOLARIS_2_3 for version 2.3 and higher
  3888.   ENVDEF=    -DSOLARIS
  3889.   
  3890.   # see also conf.h for additional compilation flags
  3891.   
  3892.   # include directories
  3893. ! INCDIRS=-I/usr/sww/include/db -I.
  3894.   
  3895.   # library directories
  3896. ! LIBDIRS=-L/usr/sww/lib
  3897.   
  3898.   # libraries required on your system
  3899.   LIBS=    -lresolv -lsocket -lnsl -lelf
  3900.   
  3901.   # location of sendmail binary (usually /usr/sbin or /usr/lib)
  3902. ! BINDIR=    ${DESTDIR}/usr/lib
  3903.   
  3904.   # location of sendmail.st file (usually /var/log or /usr/lib)
  3905.   STDIR=    ${DESTDIR}/var/log
  3906.   
  3907.   # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  3908. ! HFDIR=    ${DESTDIR}/etc/mail
  3909.   
  3910.   # additional .o files needed
  3911.   OBJADD=
  3912. ***************
  3913. *** 85,91 ****
  3914.   install-sendmail: sendmail
  3915.       ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3916.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3917. !     ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  3918.           ${STDIR}/sendmail.st
  3919.       ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3920.   
  3921. --- 87,93 ----
  3922.   install-sendmail: sendmail
  3923.       ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3924.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3925. !     ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  3926.           ${STDIR}/sendmail.st
  3927.       ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3928.   
  3929. *** src/Makefile.SunOS.OLD    Sat Dec 18 11:20:33 1993
  3930. --- src/Makefile.SunOS    Sat Dec 18 11:22:35 1993
  3931. ***************
  3932. *** 89,95 ****
  3933.   install-sendmail: sendmail
  3934.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3935.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3936. !     install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  3937.           ${STDIR}/sendmail.st
  3938.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3939.   
  3940. --- 89,95 ----
  3941.   install-sendmail: sendmail
  3942.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  3943.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  3944. !     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  3945.           ${STDIR}/sendmail.st
  3946.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  3947.   
  3948. *** src/Makefile.Titan.OLD    Wed Dec  1 09:18:46 1993
  3949. --- src/Makefile.Titan    Sat Dec 18 11:22:38 1993
  3950. ***************
  3951. *** 0 ****
  3952. --- 1,109 ----
  3953. + #
  3954. + #  This Makefile is designed to work on the old "make" program.  It does
  3955. + #  not use the obj subdirectory.  It also does not install documentation
  3956. + #  automatically -- think of it as a quick start for sites that have the
  3957. + #  old make program (I recommend that you get and port the new make if you
  3958. + #  are going to be doing any signficant work on sendmail).
  3959. + #
  3960. + #    @(#)Makefile.dist    8.7 (Berkeley) 9/3/93
  3961. + #
  3962. + # put the compiler in BSD mode
  3963. + CC=    cc -43
  3964. + # use O=-O (usual) or O=-g (debugging)
  3965. + O=    -O
  3966. + # define the database mechanisms available for map & alias lookups:
  3967. + #    -DNDBM -- use new DBM
  3968. + #    -DNEWDB -- use new Berkeley DB
  3969. + #    -DNIS -- include NIS support
  3970. + # The really old (V7) DBM library is no longer supported.
  3971. + # See READ_ME for a description of how these flags interact.
  3972. + #
  3973. + DBMDEF=    -DNDBM
  3974. + # environment definitions (e.g., -D_AIX3)
  3975. + ENVDEF=
  3976. + # see also conf.h for additional compilation flags
  3977. + # include directories
  3978. + INCDIRS=
  3979. + # loader options
  3980. + LDOPTS=
  3981. + # library directories
  3982. + LIBDIRS=
  3983. + # libraries required on your system
  3984. + LIBS=    -ldbm
  3985. + # location of sendmail binary (usually /usr/sbin or /usr/lib)
  3986. + BINDIR=    ${DESTDIR}/usr/lib
  3987. + # location of sendmail.st file (usually /var/log or /usr/lib)
  3988. + STDIR=    ${DESTDIR}/var/log
  3989. + # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  3990. + HFDIR=    ${DESTDIR}/usr/share/misc
  3991. + # additional .o files needed
  3992. + OBJADD=
  3993. + # additional pseudo-sources needed
  3994. + BEFORE=    stddef.h stdlib.h
  3995. + ###################  end of user configuration flags  ######################
  3996. + CFLAGS=    -I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
  3997. + OBJS=    alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  3998. +     deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  3999. +     map.o mci.o parseaddr.o queue.o readcf.o recipient.o \
  4000. +     savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  4001. +     trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  4002. + LINKS=    ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
  4003. + BINOWN=    root
  4004. + BINGRP=    kmem
  4005. + BINMODE=6555
  4006. + ALL=    sendmail aliases.0 newaliases.0 sendmail.0
  4007. + all: ${ALL}
  4008. + sendmail: ${BEFORE} ${OBJS}
  4009. +     ${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
  4010. + stddef.h stdlib.h:
  4011. +     cp /dev/null $@
  4012. + aliases.0: aliases.5
  4013. +     nroff -h -mandoc aliases.5 > aliases.0
  4014. + newaliases.0: newaliases.1
  4015. +     nroff -h -mandoc newaliases.1 > newaliases.0
  4016. + sendmail.0: sendmail.8
  4017. +     nroff -h -mandoc sendmail.8 > sendmail.0
  4018. + install: install-sendmail install-docs
  4019. + install-sendmail: sendmail
  4020. +     install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  4021. +     for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  4022. +     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  4023. +         ${STDIR}/sendmail.st
  4024. +     install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  4025. + # doesn't actually install them -- you may want to install pre-nroff versions
  4026. + install-docs: aliases.0 newaliases.0 sendmail.0
  4027. + clean:
  4028. +     rm -f ${OBJS} sendmail aliases.0 newaliases.0 sendmail.0
  4029. + # dependencies
  4030. + #   gross overkill, and yet still not quite enough....
  4031. + ${OBJS}: sendmail.h conf.h
  4032. *** src/Makefile.ULTRIX.OLD    Sat Dec 18 11:20:33 1993
  4033. --- src/Makefile.ULTRIX    Sat Dec 18 11:22:41 1993
  4034. ***************
  4035. *** 85,91 ****
  4036.   install-sendmail: sendmail
  4037.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  4038.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  4039. !     install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  4040.           ${STDIR}/sendmail.st
  4041.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  4042.   
  4043. --- 85,91 ----
  4044.   install-sendmail: sendmail
  4045.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  4046.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  4047. !     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  4048.           ${STDIR}/sendmail.st
  4049.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  4050.   
  4051. *** src/Makefile.UMAX.OLD    Sat Dec 18 11:20:34 1993
  4052. --- src/Makefile.UMAX    Sat Dec 18 11:22:44 1993
  4053. ***************
  4054. *** 92,98 ****
  4055.   install-sendmail: sendmail
  4056.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  4057.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  4058. !     install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  4059.           ${STDIR}/sendmail.st
  4060.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  4061.   
  4062. --- 92,98 ----
  4063.   install-sendmail: sendmail
  4064.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  4065.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  4066. !     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  4067.           ${STDIR}/sendmail.st
  4068.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  4069.   
  4070. *** src/Makefile.Utah.OLD    Sat Dec 18 11:20:34 1993
  4071. --- src/Makefile.Utah    Sat Dec 18 11:23:01 1993
  4072. ***************
  4073. *** 31,39 ****
  4074.   BINMODE=6555
  4075.   
  4076.   beforeinstall:
  4077. ! #    install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  4078. ! #        ${DESTDIR}/etc/sendmail.fc
  4079. !     install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  4080.           ${DESTDIR}/var/log/sendmail.st
  4081.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/sendmail.hf \
  4082.           ${DESTDIR}/usr/share/misc
  4083. --- 31,37 ----
  4084.   BINMODE=6555
  4085.   
  4086.   beforeinstall:
  4087. !     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  4088.           ${DESTDIR}/var/log/sendmail.st
  4089.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/sendmail.hf \
  4090.           ${DESTDIR}/usr/share/misc
  4091. *** src/Makefile.dist.OLD    Wed Dec  1 19:09:34 1993
  4092. --- src/Makefile.dist    Mon Dec 20 10:52:10 1993
  4093. ***************
  4094. *** 5,11 ****
  4095.   #  old make program (I recommend that you get and port the new make if you
  4096.   #  are going to be doing any signficant work on sendmail).
  4097.   #
  4098. ! #    @(#)Makefile.dist    8.7 (Berkeley) 9/3/93
  4099.   #
  4100.   
  4101.   # use O=-O (usual) or O=-g (debugging)
  4102. --- 5,11 ----
  4103.   #  old make program (I recommend that you get and port the new make if you
  4104.   #  are going to be doing any signficant work on sendmail).
  4105.   #
  4106. ! #    @(#)Makefile.dist    8.9 (Berkeley) 12/20/93
  4107.   #
  4108.   
  4109.   # use O=-O (usual) or O=-g (debugging)
  4110. ***************
  4111. *** 80,93 ****
  4112.   sendmail.0: sendmail.8
  4113.       nroff -h -mandoc sendmail.8 > sendmail.0
  4114.   
  4115.   install: install-sendmail install-docs
  4116.   
  4117.   install-sendmail: sendmail
  4118. !     install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  4119.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  4120. !     install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  4121.           ${STDIR}/sendmail.st
  4122. !     install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  4123.   
  4124.   # doesn't actually install them -- you may want to install pre-nroff versions
  4125.   install-docs: aliases.0 newaliases.0 sendmail.0
  4126. --- 80,95 ----
  4127.   sendmail.0: sendmail.8
  4128.       nroff -h -mandoc sendmail.8 > sendmail.0
  4129.   
  4130. + INSTALL=install
  4131.   install: install-sendmail install-docs
  4132.   
  4133.   install-sendmail: sendmail
  4134. !     ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  4135.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  4136. !     ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  4137.           ${STDIR}/sendmail.st
  4138. !     ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  4139.   
  4140.   # doesn't actually install them -- you may want to install pre-nroff versions
  4141.   install-docs: aliases.0 newaliases.0 sendmail.0
  4142. *** src/READ_ME.OLD    Sun Nov  7 13:11:29 1993
  4143. --- src/READ_ME    Wed Jan 12 06:00:15 1994
  4144. ***************
  4145. *** 30,36 ****
  4146.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  4147.   # SUCH DAMAGE.
  4148.   #
  4149. ! #    @(#)READ_ME    8.31 (Berkeley) 10/31/93
  4150.   #
  4151.   
  4152.   This directory contains the source files for sendmail.
  4153. --- 30,36 ----
  4154.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  4155.   # SUCH DAMAGE.
  4156.   #
  4157. ! #    @(#)READ_ME    8.47 (Berkeley) 1/12/94
  4158.   #
  4159.   
  4160.   This directory contains the source files for sendmail.
  4161. ***************
  4162. *** 39,49 ****
  4163.   
  4164.       eqn ../doc/op.me | pic | ditroff -me
  4165.   
  4166. ! The Makefile is for the new (4.4BSD) Berkeley make, available from
  4167. ! ftp.uu.net in the directory /systems/unix/bsd-sources/usr.bin/make.
  4168. ! (Paul Southworth <pauls@umich.edu> published a description of porting
  4169. ! this make in comp.unix.bsd.)  This Makefile has assumptions about the
  4170. ! 4.4 file system layout built in.
  4171.   
  4172.   There is also a Makefile.dist which is much less clever, but works on
  4173.   the old traditional make.  You can use this using:
  4174. --- 39,48 ----
  4175.   
  4176.       eqn ../doc/op.me | pic | ditroff -me
  4177.   
  4178. ! The Makefile is for the new (4.4BSD) Berkeley make and uses syntax
  4179. ! that is not recognized by older makes.  It also has assumptions
  4180. ! about the 4.4 file system layout built in.  See below for details
  4181. ! about other Makefiles.
  4182.   
  4183.   There is also a Makefile.dist which is much less clever, but works on
  4184.   the old traditional make.  You can use this using:
  4185. ***************
  4186. *** 50,75 ****
  4187.   
  4188.       make -f Makefile.dist
  4189.   
  4190. ! There are a bunch of other Makefiles for other systems -- these are
  4191. ! the ones that I use, they have "Berkeley quirks" in them, and I don't
  4192. ! guarantee that they will work unmodified in your environment.  However,
  4193. ! they are all designed for the old make and can be used to help you get
  4194. ! started.  They have names like "Makefile.HPUX".  Many of them include
  4195. ! -I/usr/sww/include/db and -L/usr/sww/lib -- this is Berkeley's
  4196. ! location for the new database libraries, described below.
  4197.   
  4198.   There is also a shell script (makesendmail) that tries to be clever
  4199.   about using object subdirectories.  It's pretty straightforward, and
  4200.   may help if you share a source tree among different architectures.
  4201.   
  4202. ! IMPORTANT:  DO NOT USE OPTIMIZATION (``-O'') IF YOU ARE RUNNING GCC
  4203. ! 2.4.x.  THERE IS A BUG IN THE GCC OPTIMIZER THAT CAUSES SENDMAIL TO
  4204. ! FAIL MISERABLY.
  4205.   
  4206. ! IMPORTANT:  Read the appropriate paragraphs in the section on
  4207. ! ``Operating System and Compile Quirks''.
  4208.   
  4209.   
  4210.   +----------------------+
  4211.   | DATABASE DEFINITIONS |
  4212.   +----------------------+
  4213. --- 49,126 ----
  4214.   
  4215.       make -f Makefile.dist
  4216.   
  4217. ! **************************************************
  4218. ! **  Read below for more details of Makefiles.    **
  4219. ! **************************************************
  4220.   
  4221.   There is also a shell script (makesendmail) that tries to be clever
  4222.   about using object subdirectories.  It's pretty straightforward, and
  4223.   may help if you share a source tree among different architectures.
  4224.   
  4225. ! **************************************************************************
  4226. ! **  IMPORTANT:  DO NOT USE OPTIMIZATION (``-O'') IF YOU ARE RUNNING    **
  4227. ! **  GCC 2.4.x or 2.5.x.  THERE IS A BUG IN THE GCC OPTIMIZER THAT    **
  4228. ! **  CAUSES SENDMAIL COMPILES TO FAIL MISERABLY.                **
  4229. ! **************************************************************************
  4230.   
  4231. ! Jim Wilson of Cygnus believes he has found the problem -- it will
  4232. ! probably be fixed in GCC 2.5.6 -- but until this is verified, be
  4233. ! very suspicious of gcc -O.
  4234.   
  4235. + **************************************************************************
  4236. + **  IMPORTANT:  Read the appropriate paragraphs in the section on    **
  4237. + **  ``Operating System and Compile Quirks''.                **
  4238. + **************************************************************************
  4239.   
  4240. + +-----------+
  4241. + | MAKEFILES |
  4242. + +-----------+
  4243. + The "Makefile"s in these directories are from 4.4 BSD, and hence
  4244. + really only work properly if you are on a 4.4 system.  In particular,
  4245. + they use new syntax that will not be recognized on old make programs,
  4246. + and some of them do things like ``.include ../../Makefile.inc'' to
  4247. + pick up some system defines.  If you are getting sendmail separately,
  4248. + these files won't be included in the distribution, as they are
  4249. + outside of the sendmail tree.
  4250. + Instead, you should use one of the other Makefiles, such as
  4251. + Makefile.SunOS for a SunOS system, and so forth.  These should
  4252. + work with the version of make that is appropriate for that
  4253. + system.
  4254. + There are a bunch of other Makefiles for other systems with names
  4255. + like Makefile.HPUX for an HP-UX system.  They use the version of
  4256. + make that is native for that system.  These are the Makefiles that
  4257. + I use, and they have "Berkeley quirks" in them.  I can't guarantee
  4258. + that they will work unmodified in your environment.  Many of them
  4259. + include -I/usr/sww/include/db and -L/usr/sww/lib -- this is Berkeley's
  4260. + location (the ``Software Warehouse'') for the new database libraries,
  4261. + described below.  You don't have to remove these definitions if you
  4262. + don't have these directories.
  4263. + Please look for an appropriate Makefile before you start trying to
  4264. + compile with Makefile or Makefile.dist.
  4265. + If you want to port the new Berkeley make, you can get it from
  4266. + ftp.uu.net in the directory /systems/unix/bsd-sources/usr.bin/make.
  4267. + Diffs and instructions for building this version of make under
  4268. + SunOS 4.1.x are available on ftp.css.itd.umich.edu in
  4269. + /pub/systems/sun/Net2-make.sun4.diff.Z.  Diffs and instructions
  4270. + for building this version of make under IBM AIX 3.2.4 are available
  4271. + on ftp.uni-stuttgart.de in /sw/src/patches/bsd-make-rus-patches.
  4272. + Paul Southworth <pauls@umich.edu> published a description of porting
  4273. + this make in comp.unix.bsd.
  4274. + The complete text of the Makefile.inc that is in the parent of the
  4275. + sendmail directory is:
  4276. +     #    @(#)Makefile.inc    8.1 (Berkeley) 6/6/93
  4277. +     BINDIR?=    /usr/sbin
  4278.   +----------------------+
  4279.   | DATABASE DEFINITIONS |
  4280.   +----------------------+
  4281. ***************
  4282. *** 83,89 ****
  4283.   longer supported), and NIS (Network Information Services).  Used alone
  4284.   these just include the support they indicate.  [If you are using NEWDB,
  4285.   get the latest version from FTP.CS.Berkeley.EDU in /ucb/4bsd.  DO NOT
  4286. ! use the version from the Net2 distribution!]
  4287.   
  4288.   If NEWDB and NDBM are defined (but not NIS), then sendmail will read
  4289.   NDBM format alias files, but the next time a newaliases is run the
  4290. --- 134,142 ----
  4291.   longer supported), and NIS (Network Information Services).  Used alone
  4292.   these just include the support they indicate.  [If you are using NEWDB,
  4293.   get the latest version from FTP.CS.Berkeley.EDU in /ucb/4bsd.  DO NOT
  4294. ! use the version from the Net2 distribution!  However, if you are on
  4295. ! BSD/386 or 386BSD-based systems, use the one that already exists
  4296. ! on your system.  You may need to define OLD_NEWDB to do this.]
  4297.   
  4298.   If NEWDB and NDBM are defined (but not NIS), then sendmail will read
  4299.   NDBM format alias files, but the next time a newaliases is run the
  4300. ***************
  4301. *** 119,124 ****
  4302. --- 172,179 ----
  4303.   Makefile:
  4304.   
  4305.   SOLARIS        Define this if you are running Solaris 2.0 or higher.
  4306. + SOLARIS_2_3    Define this if you are running Solaris 2.3 or higher.
  4307. + SUNOS403    Define this if you are running SunOS 4.0.3.
  4308.   NeXT        Define this if you are on a NeXT box.  (This one may
  4309.           be pre-defined for you.)  There are other hacks you
  4310.           have to make -- see below.
  4311. ***************
  4312. *** 125,130 ****
  4313. --- 180,186 ----
  4314.   _AIX3        Define this if you are IBM AIX 3.x.
  4315.   RISCOS        Define this if you are running RISC/os from MIPS.
  4316.   _SCO_unix_    Define this if you are on SCO UNIX.
  4317. + _SCO_unix_4_2    Define this if you are on SCO Open Server 3.2v4.
  4318.   
  4319.   If you are a system that sendmail has already been ported to, you
  4320.   probably won't have to touch these.  But if you are porting, you may
  4321. ***************
  4322. *** 131,137 ****
  4323.   have to tweak the following compilation flags in conf.h in order to
  4324.   get it to compile and link properly:
  4325.   
  4326. ! SYSTEM5        Adjust for System V.
  4327.   SYS5SIGNALS    Use System V signal semantics -- the signal handler
  4328.           is automatically dropped when the signal is caught.
  4329.           If this is not set, use POSIX/BSD semantics, where the
  4330. --- 187,193 ----
  4331.   have to tweak the following compilation flags in conf.h in order to
  4332.   get it to compile and link properly:
  4333.   
  4334. ! SYSTEM5        Adjust for System V (not necessarily Release 4).
  4335.   SYS5SIGNALS    Use System V signal semantics -- the signal handler
  4336.           is automatically dropped when the signal is caught.
  4337.           If this is not set, use POSIX/BSD semantics, where the
  4338. ***************
  4339. *** 166,177 ****
  4340.           your system has setresuid(2), (for example, on HP-UX) in
  4341.           which case you will also have to #define setreuid(r, e)
  4342.           to be the appropriate call.  Some systems (such as Solaris)
  4343. !         have a compatibility routine that doesn't work properly.
  4344.           The important thing is that you have a call that will set
  4345. !         the effective uid independently of the real or saved uid.
  4346. !         Setting this improves the security somewhat, since
  4347. !         sendmail doesn't have to read .forward and :include: files
  4348. !         as root.
  4349.   GIDSET_T    The type of entries in a gidset passed as the second
  4350.           argument to getgroups(2).  Historically this has been an
  4351.           int, so this is the default, but some systems (such as
  4352. --- 222,261 ----
  4353.           your system has setresuid(2), (for example, on HP-UX) in
  4354.           which case you will also have to #define setreuid(r, e)
  4355.           to be the appropriate call.  Some systems (such as Solaris)
  4356. !         have a compatibility routine that doesn't work properly,
  4357. !         but may have "saved user ids" properly implemented so you
  4358. !         can ``#define setreuid(r, e) seteuid(e)'' and have it work.
  4359.           The important thing is that you have a call that will set
  4360. !         the effective uid independently of the real or saved uid
  4361. !         and be able to set the effective uid back again when done.
  4362. !         There's a test program in ../test/t_setreuid.c that will
  4363. !         try things on your system.  Setting this improves the
  4364. !         security, since sendmail doesn't have to read .forward
  4365. !         and :include: files as root.  There are certain attacks
  4366. !         that may be unpreventable without this call.
  4367. ! HASLSTAT    Define this if you have symbolic links (and thus the
  4368. !         lstat(2) system call).  This improves security.  Unlike
  4369. !         most other options, this one is on by default, so you
  4370. !         need to #undef it in conf.h if you don't have symbolic
  4371. !         links (these days everyone does).
  4372. ! NEEDGETOPT    Define this if you need a reimplementation of getopt(3).
  4373. !         On some systems, getopt does very odd things if called
  4374. !         to scan the arguments twice.  This flag will ask sendmail
  4375. !         to compile in a local version of getopt that works
  4376. !         properly.
  4377. ! NEEDSTRTOL    Define this if your standard C library does not define
  4378. !         strtol(3).  This will compile in a local version.
  4379. ! NEEDVPRINTF    Define this if your standard C library does not define
  4380. !         vprintf(3).  Note that the resulting fake implementation
  4381. !         is not very elegant and may not even work on some
  4382. !         architectures.
  4383. ! HASGETUSERSHELL    Define this to 1 if you have getusershell(3) in your
  4384. !         standard C library.  If this is not defined, or is defined
  4385. !         to be 0, sendmail will scan the /etc/shells file (no
  4386. !         NIS-style support, defaults to /bin/sh and /bin/csh if
  4387. !         that file does not exist) to get a list of unrestricted
  4388. !         user shells.  This is used to determine whether users
  4389. !         are allowed to forward their mail to a program or a file.
  4390.   GIDSET_T    The type of entries in a gidset passed as the second
  4391.           argument to getgroups(2).  Historically this has been an
  4392.           int, so this is the default, but some systems (such as
  4393. ***************
  4394. *** 206,211 ****
  4395. --- 290,306 ----
  4396.   WAITUNION    The wait(2) routine takes a "union wait" argument instead
  4397.           of an integer argument.  This is for compatibility with
  4398.           old versions of BSD.
  4399. + SCANF        You can set this to extend the F command to accept a
  4400. +         scanf string -- this gives you a primitive parser for
  4401. +         class definitions -- BUT it can make you vulnerable to
  4402. +         core dumps if the target file is poorly formed.
  4403. + SYSLOG_BUFSIZE    You can define this to be the size of the buffer that
  4404. +         syslog accepts.  If it is not defined, it assumes a
  4405. +         1024-byte buffer.  If the buffer is very small (under
  4406. +         256 bytes) the log message format changes -- each
  4407. +         e-mail message will log many more messages, since it
  4408. +         will log each piece of information as a separate line
  4409. +         in syslog.
  4410.   
  4411.   
  4412.   +-----------------------+
  4413. ***************
  4414. *** 226,235 ****
  4415.           Normally defined in the Makefile.
  4416.   USERDB        Include support for the User Information Database.  Implied
  4417.           by NEWDB in conf.h.
  4418. ! IDENTPROTO    Define this to get IDENT (RFC 1413) protocol support.
  4419.           This is assumed unless you are running on Ultrix or
  4420.           HP-UX, both of which have a problem in the UDP
  4421. !         implementation.
  4422.   MIME        Include support for MIME-encapsulated error messages.
  4423.   LOG        Set this to get syslog(3) support.  Defined by default
  4424.           in conf.h.  You want this if at all possible.
  4425. --- 321,331 ----
  4426.           Normally defined in the Makefile.
  4427.   USERDB        Include support for the User Information Database.  Implied
  4428.           by NEWDB in conf.h.
  4429. ! IDENTPROTO    Define this as 1 to get IDENT (RFC 1413) protocol support.
  4430.           This is assumed unless you are running on Ultrix or
  4431.           HP-UX, both of which have a problem in the UDP
  4432. !         implementation.  You can define it to be 0 to explicitly
  4433. !         turn off IDENT protocol support.
  4434.   MIME        Include support for MIME-encapsulated error messages.
  4435.   LOG        Set this to get syslog(3) support.  Defined by default
  4436.           in conf.h.  You want this if at all possible.
  4437. ***************
  4438. *** 256,265 ****
  4439.           default in conf.h.
  4440.   
  4441.   
  4442. ! +-------------------------------------+
  4443.   | OPERATING SYSTEM AND COMPILE QUIRKS |
  4444.   +-------------------------------------+
  4445.   
  4446.   SunOS 4.x (Solaris 1.x)
  4447.       You may have to use -lresolv on SunOS.  However, beware that
  4448.       this links in a new version of gethostbyname that does not
  4449. --- 352,420 ----
  4450.           default in conf.h.
  4451.   
  4452.   
  4453. ! +---------------------+
  4454. ! | DNS/RESOLVER ISSUES |
  4455. ! +---------------------+
  4456. ! Many systems have old versions of the resolver library.  At a minimum,
  4457. ! you should be running BIND 4.8.3; older versions may compile, but they
  4458. ! have known bugs that should give you pause.
  4459. ! Common problems in old versions include "undefined" errors for
  4460. ! dn_skipname.
  4461. ! Some people have had a problem with BIND 4.9; it uses some routines
  4462. ! that it expects to be externally defined such as strerror().  It may
  4463. ! help to link with "-l44bsd" to solve this problem.
  4464. ! !PLEASE! be sure to link with the same version of the resolver as
  4465. ! the header files you used -- some people have used the 4.9 headers
  4466. ! and linked with BIND 4.8 or vice versa, and it doesn't work.
  4467. ! Unfortunately, it doesn't fail in an obvious way -- things just
  4468. ! subtlely don't work.
  4469. ! +-------------------------------------+
  4470.   | OPERATING SYSTEM AND COMPILE QUIRKS |
  4471.   +-------------------------------------+
  4472.   
  4473. + GCC 2.5.x problems  *** IMPORTANT ***
  4474. +     Date: Mon, 29 Nov 93 19:08:44 PST
  4475. +     From: wilson@cygnus.com (Jim Wilson)
  4476. +     Message-Id: <9311300308.AA04608@cygnus.com>
  4477. +     To: kenner@vlsi1.ultra.nyu.edu
  4478. +     Subject: [cattelan@thebarn.com: gcc 2.5.4-2.5.5 -O bug]
  4479. +     Cc: cattelan@thebarn.com, rms@gnu.ai.mit.edu, sendmail@cs.berkeley.edu
  4480. +     This fixes a problem that occurs when gcc 2.5.5 is used to compile
  4481. +     sendmail 8.6.4 with optimization on a sparc.
  4482. +     Mon Nov 29 19:00:14 1993  Jim Wilson  (wilson@sphagnum.cygnus.com)
  4483. +         * reload.c (find_reloads_toplev): Replace obsolete reference to
  4484. +         BYTE_LOADS_*_EXTEND with LOAD_EXTEND_OP.
  4485. +     *** clean-ss-931128/reload.c    Sun Nov 14 16:20:01 1993
  4486. +     --- ss-931128/reload.c  Mon Nov 29 18:52:55 1993
  4487. +     *************** find_reloads_toplev (x, opnum, type, ind
  4488. +     *** 3888,3894 ****
  4489. +          force a reload in that case.  So we should not do anything here.  */
  4490. +       
  4491. +         else if (regno >= FIRST_PSEUDO_REGISTER
  4492. +     ! #if defined(BYTE_LOADS_ZERO_EXTEND) || defined(BYTE_LOADS_SIGN_EXTEND)
  4493. +                && (GET_MODE_SIZE (GET_MODE (x))
  4494. +                <= GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))
  4495. +       #endif
  4496. +     --- 3888,3894 ----
  4497. +          force a reload in that case.  So we should not do anything here.  */
  4498. +       
  4499. +         else if (regno >= FIRST_PSEUDO_REGISTER
  4500. +     ! #ifdef LOAD_EXTEND_OP
  4501. +                && (GET_MODE_SIZE (GET_MODE (x))
  4502. +                <= GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))
  4503. +       #endif
  4504.   SunOS 4.x (Solaris 1.x)
  4505.       You may have to use -lresolv on SunOS.  However, beware that
  4506.       this links in a new version of gethostbyname that does not
  4507. ***************
  4508. *** 268,274 ****
  4509.       Some people have reported problems with the SunOS version of
  4510.       -lresolv and/or in.named, and suggest that you get a newer
  4511.       version.  The symptoms are delays when you connect to the
  4512. !     SMTP server on a SunOS machine.  There is a version of BIND
  4513.       version 4.9 on gatekeeper.DEC.COM in pub/BSD/bind/4.9.
  4514.   
  4515.       There is substantial disagreement about whether you can make
  4516. --- 423,430 ----
  4517.       Some people have reported problems with the SunOS version of
  4518.       -lresolv and/or in.named, and suggest that you get a newer
  4519.       version.  The symptoms are delays when you connect to the
  4520. !     SMTP server on a SunOS machine or having your domain added to
  4521. !     addresses inappropriately.  There is a version of BIND
  4522.       version 4.9 on gatekeeper.DEC.COM in pub/BSD/bind/4.9.
  4523.   
  4524.       There is substantial disagreement about whether you can make
  4525. ***************
  4526. *** 299,313 ****
  4527.   
  4528.       The Solaris "syslog" function is apparently limited to something
  4529.       about 90 characters because of a kernel limitation.  If you have
  4530. !     source code, you can probably up this number.  Bill Wisner
  4531. !     <wisner@well.sf.ca.us> was able to get an unofficial, unsupported
  4532. !     patch.
  4533.   
  4534.   OSF/1
  4535. !     If you are compiling on OSF/1 (DEC Alpha), you must use -lmld
  4536. !     and -non_shared (otherwise it core dumps on startup).  Also,
  4537. !     the enclosed makefile removed /usr/sbin/smtpd; if you need it,
  4538. !     just create the link to the sendmail binary.
  4539.   
  4540.   NeXT
  4541.       If you are compiling on NeXT, you will have to create an empty
  4542. --- 455,475 ----
  4543.   
  4544.       The Solaris "syslog" function is apparently limited to something
  4545.       about 90 characters because of a kernel limitation.  If you have
  4546. !     source code, you can probably up this number.  The syslogd patch
  4547. !     is included in kernel jumbo patch for Solaris 2.2 as of revision
  4548. !     -39 or so.  At least one person is running with patch 100999-45
  4549. !     and their long lost sendmail logging is finally showing up.  At
  4550. !     least one other person is running with patch 101318 installed
  4551. !     under Solaris 2.3 with success.
  4552.   
  4553.   OSF/1
  4554. !     If you are compiling on OSF/1 (DEC Alpha), you must use 
  4555. !     -L/usr/shlib (otherwise it core dumps on startup).  You may also
  4556. !     need -mld to get the nlist() function, although some versions
  4557. !     apparently don't need this.
  4558. !     
  4559. !     Also, the enclosed makefile removed /usr/sbin/smtpd; if you need
  4560. !     it, just create the link to the sendmail binary.
  4561.   
  4562.   NeXT
  4563.       If you are compiling on NeXT, you will have to create an empty
  4564. ***************
  4565. *** 329,338 ****
  4566.   
  4567.       You may have to use -DNeXT.
  4568.   
  4569. ! BSDI (BSD/386)
  4570. !     I have reports that the "m4" from BSDI won't handle the config
  4571. !     files properly.  I haven't had a chance to test this myself.
  4572.   
  4573.   4.3BSD
  4574.       If you are running a "virgin" version of 4.3BSD, you'll have
  4575.       a very old resolver and be missing some header files.  The
  4576. --- 491,522 ----
  4577.   
  4578.       You may have to use -DNeXT.
  4579.   
  4580. ! BSDI (BSD/386) 1.0, NetBSD 0.9, FreeBSD 1.0
  4581. !     The "m4" from BSDI won't handle the config files properly.
  4582. !     I haven't had a chance to test this myself.
  4583.   
  4584. +     The M4 shipped in FreeBSD and NetBSD 0.9 don't handle the config
  4585. +     files properly. One must use either GNU m4 1.1 or the PD-M4
  4586. +     recently posted in comp.os.386bsd.bugs (and maybe others).
  4587. +     NetBSD-current includes the PD-M4 (as stated in the NetBSD file
  4588. +     CHANGES).
  4589. +     
  4590. +     FreeBSD 1.0 RELEASE has uname(2) now. Use -DUSEUNAME in order to
  4591. +     use it (look into Makefile.FreeBSD). NetBSD-current may have
  4592. +     it too but it has not been verified.
  4593. +     You cannot port the latest version of the Berkeley db library
  4594. +     and use it with sendmail without recompiling the world.  This
  4595. +     is because C library routines use the older version which have
  4596. +     incompatible header files -- the result is that it can't read
  4597. +     other system files, such as /etc/passwd, unless you use the
  4598. +     new db format throughout your system.  You should normally just
  4599. +     use the version of db supplied in your release.  You may need
  4600. +     to use -DOLD_NEWDB to make this work -- this turns off some
  4601. +     new interface calls (for file locking) that are not in older
  4602. +     versions of db.  You'll get compile errors if you need this
  4603. +     flag and don't have it set.
  4604.   4.3BSD
  4605.       If you are running a "virgin" version of 4.3BSD, you'll have
  4606.       a very old resolver and be missing some header files.  The
  4607. ***************
  4608. *** 346,376 ****
  4609.       copy ../contrib/oldbind.compat.c into src and add
  4610.       oldbind.compat.o to OBJADD in the Makefile.
  4611.   
  4612. - Linux
  4613. -     From: Karl London <karl@borg.demon.co.uk>
  4614. -     Subject: Little bit to add to a readme for Linux for 8.6
  4615. -     Date: Fri, 10 Sep 1993 20:16:05 +0100 (BST)
  4616. -     Below is a copy of a section of the /usr/include/unistd.h from
  4617. -     linux libc-4.4.1 which needs changing because of a bug in the
  4618. -     header files. Should be fixed for future releases..
  4619. -     Karl
  4620. -     The #if 0 and #endif are new!!
  4621. -     -------
  4622. -        If OPTS begins with `--', then non-option arguments
  4623. -        are treated as arguments to the option '\0'.
  4624. -        This behavior is specific to the GNU `getopt'.  */
  4625. -     #if 0
  4626. -     extern int getopt __P ((int __argc, char *__const * __argv,
  4627. -                 __const char *__opts));
  4628. -     #endif
  4629. -     extern int opterr;
  4630. -     extern int optind;
  4631.   A/UX
  4632.       Date: Tue, 12 Oct 1993 18:28:28 -0400 (EDT)
  4633.       From: "Eric C. Hagberg" <hagberg@med.cornell.edu>
  4634. --- 530,535 ----
  4635. ***************
  4636. *** 401,406 ****
  4637. --- 560,623 ----
  4638.       DG/UX -- the person who has this working, Douglas Anderson
  4639.       <dlander@afterlife.ncsc.mil>, used procmail instead.
  4640.   
  4641. + System V Release 4 Based Systems
  4642. +     There is a single Makefile that is intended for all SVR4-based
  4643. +     systems (called Makefile.SVR4).  It defines __svr4__, which is
  4644. +     predefined by some compilers.  If your compiler already defines
  4645. +     this compile variable, you can delete the definition from the
  4646. +     Makefile.
  4647. +     It's been tested on Dell Issue 2.2.
  4648. + DELL SVR4
  4649. +     Date:      Mon, 06 Dec 1993 10:42:29 EST
  4650. +     From: "Kimmo Suominen" <kim@grendel.lut.fi>
  4651. +     Message-ID: <2d0352f9.lento29@lento29.UUCP>
  4652. +     To: eric@cs.berkeley.edu
  4653. +     Cc: sendmail@cs.berkeley.edu
  4654. +     Subject:   Notes for DELL SVR4
  4655. +     Eric,
  4656. +     Here are some notes for compiling Sendmail 8.6.4 on DELL SVR4.  I ran
  4657. +     across these things when helping out some people who contacted me by
  4658. +     e-mail.
  4659. +     1) Use gcc 2.4.5 (or later?).  Dell distributes gcc 2.1 with their
  4660. +        Issue 2.2 Unix.  It is too old, and gives you problems with
  4661. +        clock.c, because sigset_t won't get defined in <sys/signal.h>.
  4662. +        This is due to a problematic protection rule in there, and is
  4663. +        fixed with gcc 2.4.5.
  4664. +     2) If you don't use the new Berkeley DB (-DNEWDB), then you need
  4665. +        to add "-lc -lucb" to the libraries to link with.  This is because
  4666. +        the -ldbm distributed by Dell needs the bcopy, bcmp and bzero
  4667. +        functions.  It is important that you specify both libraries in
  4668. +        the given order to be sure you only get the BSTRING functions
  4669. +        from the UCB library (and not the signal routines etc.).
  4670. +     3) Don't leave out "-lelf" even if compiling with "-lc -lucb".
  4671. +        The UCB library also has another copy of the nlist routines,
  4672. +        but we do want the ones from "-lelf".
  4673. +     If anyone needs a compiled gcc 2.4.5 and/or a ported DB library, they
  4674. +     can use anonymous ftp to fetch them from lut.fi in the /kim directory. 
  4675. +     They are copies of what I use on grendel.lut.fi, and offering them
  4676. +     does not imply that I would also support them.  I have sent the DB
  4677. +     port for SVR4 back to Keith Bostic for inclusion in the official
  4678. +     distribution, but I haven't heard anything from him as of today.
  4679. +     - gcc-2.4.5-svr4.tar.gz    (gcc 2.4.5 and the corresponding libg++)
  4680. +     - db-1.72.tar.gz    (with source, objects and a installed copy)
  4681. +     Cheers
  4682. +     + Kim
  4683. +     -- 
  4684. +      *  Kimmo.Suominen@lut.fi  *  SysVr4 enthusiast at GRENDEL.LUT.FI  *
  4685. +     *    KIM@FINFILES.BITNET   *  Postmaster and Hostmaster at LUT.FI   *
  4686. +      *    + 358 200 865 718    *  Unix area moderator at NIC.FUNET.FI  *
  4687.   Non-DNS based sites
  4688.       This version of sendmail always tries to connect to the Domain
  4689.       Name System (DNS) to resolve names, regardless of the setting
  4690. ***************
  4691. *** 426,431 ****
  4692. --- 643,684 ----
  4693.       by the double call.  Use the version in conf.c instead.
  4694.   
  4695.   
  4696. + +--------------+
  4697. + | MANUAL PAGES |
  4698. + +--------------+
  4699. + The manual pages have been written against the -mandoc macros
  4700. + instead of the -man macros.  The latest version of groff has them
  4701. + included.  You can also get a copy from FTP.UU.NET in directory
  4702. + /systems/unix/bsd-sources/share/tmac.
  4703. + +-----------------+
  4704. + | DEBUGGING HOOKS |
  4705. + +-----------------+
  4706. + As of 8.6.5, sendmail daemons will catch a SIGUSR1 signal and log
  4707. + some debugging output (logged at LOG_DEBUG severity).  The
  4708. + information dumped is:
  4709. +  * The value of the $j macro.
  4710. +  * A warning if $j is not in the set $=w.
  4711. +  * A list of the open file descriptors.
  4712. +  * The contents of the connection cache.
  4713. +  * If ruleset 89 is defined, it is evaluated and the results printed.
  4714. + This allows you to get information regarding the runtime state of the
  4715. + daemon on the fly.  This should not be done too frequently, since
  4716. + the process of rewriting may lose memory which will not be recovered.
  4717. + Also, ruleset 89 may call non-reentrant routines, so there is a small
  4718. + non-zero probability that this will cause other problems.  It is
  4719. + really only for debugging serious problems.
  4720. + A typical formulation of ruleset 89 would be:
  4721. +     R$*        $@ $>0 some test address
  4722.   +-----------------------------+
  4723.   | DESCRIPTION OF SOURCE FILES |
  4724.   +-----------------------------+
  4725. ***************
  4726. *** 489,492 ****
  4727.   
  4728.   Eric Allman
  4729.   
  4730. ! (Version 8.31, last update 10/31/93 11:32:52)
  4731. --- 742,745 ----
  4732.   
  4733.   Eric Allman
  4734.   
  4735. ! (Version 8.47, last update 1/12/94 05:59:56)
  4736. *** src/alias.c.OLD    Thu Nov 11 06:14:30 1993
  4737. --- src/alias.c    Sat Dec 11 14:21:35 1993
  4738. ***************
  4739. *** 36,42 ****
  4740.   # include <pwd.h>
  4741.   
  4742.   #ifndef lint
  4743. ! static char sccsid[] = "@(#)alias.c    8.19 (Berkeley) 10/31/93";
  4744.   #endif /* not lint */
  4745.   
  4746.   
  4747. --- 36,42 ----
  4748.   # include <pwd.h>
  4749.   
  4750.   #ifndef lint
  4751. ! static char sccsid[] = "@(#)alias.c    8.21 (Berkeley) 12/11/93";
  4752.   #endif /* not lint */
  4753.   
  4754.   
  4755. ***************
  4756. *** 144,150 ****
  4757.       owner = aliaslookup(obuf, e);
  4758.       if (owner != NULL)
  4759.       {
  4760. !         if (strchr(owner, ',') != NULL)
  4761.               owner = obuf;
  4762.           a->q_owner = newstr(owner);
  4763.       }
  4764. --- 144,150 ----
  4765.       owner = aliaslookup(obuf, e);
  4766.       if (owner != NULL)
  4767.       {
  4768. !         if (strpbrk(owner, ",:/|\"") != NULL)
  4769.               owner = obuf;
  4770.           a->q_owner = newstr(owner);
  4771.       }
  4772. ***************
  4773. *** 570,576 ****
  4774.           }
  4775.           if (parseaddr(line, &al, RF_COPYALL, ':', NULL, CurEnv) == NULL)
  4776.           {
  4777. !             syserr("554 %s... illegal alias name", al.q_paddr);
  4778.               continue;
  4779.           }
  4780.   
  4781. --- 570,576 ----
  4782.           }
  4783.           if (parseaddr(line, &al, RF_COPYALL, ':', NULL, CurEnv) == NULL)
  4784.           {
  4785. !             syserr("554 %.40s... illegal alias name", line);
  4786.               continue;
  4787.           }
  4788.   
  4789. *** src/cdefs.h.OLD    Tue Jan  4 09:53:56 1994
  4790. --- src/cdefs.h    Fri Jan  7 17:20:58 1994
  4791. ***************
  4792. *** 2,7 ****
  4793. --- 2,10 ----
  4794.    * Copyright (c) 1991, 1993
  4795.    *    The Regents of the University of California.  All rights reserved.
  4796.    *
  4797. +  * This code is derived from software contributed to Berkeley by
  4798. +  * Berkeley Software Design, Inc.
  4799. +  *
  4800.    * Redistribution and use in source and binary forms, with or without
  4801.    * modification, are permitted provided that the following conditions
  4802.    * are met:
  4803. ***************
  4804. *** 30,36 ****
  4805.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  4806.    * SUCH DAMAGE.
  4807.    *
  4808. !  *    @(#)cdefs.h    8.2 (Berkeley) 10/4/93
  4809.    */
  4810.   
  4811.   #ifndef    _CDEFS_H_
  4812. --- 33,39 ----
  4813.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  4814.    * SUCH DAMAGE.
  4815.    *
  4816. !  *    @(#)cdefs.h    8.5 (Berkeley) 1/4/94
  4817.    */
  4818.   
  4819.   #ifndef    _CDEFS_H_
  4820. ***************
  4821. *** 56,64 ****
  4822.   #define    __CONCAT(x,y)    x ## y
  4823.   #define    __STRING(x)    #x
  4824.   
  4825. ! #if !defined(__GNUC__) && !defined(__cplusplus)
  4826. ! #define    inline
  4827. ! #endif
  4828.   
  4829.   #else    /* !(__STDC__ || __cplusplus) */
  4830.   #define    __P(protos)    ()        /* traditional C preprocessor */
  4831. --- 59,74 ----
  4832.   #define    __CONCAT(x,y)    x ## y
  4833.   #define    __STRING(x)    #x
  4834.   
  4835. ! #define    __const        const        /* define reserved names to standard */
  4836. ! #define    __signed    signed
  4837. ! #define    __volatile    volatile
  4838. ! #if defined(__cplusplus)
  4839. ! #define    __inline    inline        /* convert to C++ keyword */
  4840. ! #else
  4841. ! #ifndef __GNUC__
  4842. ! #define    __inline            /* delete GCC keyword */
  4843. ! #endif /* !__GNUC__ */
  4844. ! #endif /* !__cplusplus */
  4845.   
  4846.   #else    /* !(__STDC__ || __cplusplus) */
  4847.   #define    __P(protos)    ()        /* traditional C preprocessor */
  4848. ***************
  4849. *** 65,98 ****
  4850.   #define    __CONCAT(x,y)    x/**/y
  4851.   #define    __STRING(x)    "x"
  4852.   
  4853. ! #ifdef __GNUC__
  4854. ! #define    const        __const        /* GCC: ANSI C with -traditional */
  4855. ! #define    inline        __inline
  4856. ! #define    signed        __signed
  4857. ! #define    volatile    __volatile
  4858. ! #else    /* !__GNUC__ */
  4859.   #define    const                /* delete ANSI C keywords */
  4860.   #define    inline
  4861.   #define    signed
  4862.   #define    volatile
  4863.   #endif    /* !__GNUC__ */
  4864.   #endif    /* !(__STDC__ || __cplusplus) */
  4865.   
  4866.   /*
  4867. !  * GCC has extensions for declaring functions as `pure' (always returns
  4868. !  * the same value given the same inputs, i.e., has no external state and
  4869. !  * no side effects) and `dead' (nonreturning).  These mainly affect
  4870. !  * optimization and warnings.  Unfortunately, GCC complains if these are
  4871. !  * used under strict ANSI mode (`gcc -ansi -pedantic'), hence we need to
  4872. !  * define them only if compiling without this.
  4873.    */
  4874.   #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
  4875. ! #define __dead __volatile
  4876. ! #define __pure __const
  4877. ! #else
  4878. ! #define __dead
  4879. ! #define __pure
  4880.   #endif
  4881.   
  4882.   #endif /* !_CDEFS_H_ */
  4883. --- 75,122 ----
  4884.   #define    __CONCAT(x,y)    x/**/y
  4885.   #define    __STRING(x)    "x"
  4886.   
  4887. ! #ifndef __GNUC__
  4888. ! #define    __const                /* delete pseudo-ANSI C keywords */
  4889. ! #define    __inline
  4890. ! #define    __signed
  4891. ! #define    __volatile
  4892. ! /*
  4893. !  * In non-ANSI C environments, new programs will want ANSI-only C keywords
  4894. !  * deleted from the program and old programs will want them left alone.
  4895. !  * When using a compiler other than gcc, programs using the ANSI C keywords
  4896. !  * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
  4897. !  * When using "gcc -traditional", we assume that this is the intent; if
  4898. !  * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
  4899. !  */
  4900. ! #ifndef    NO_ANSI_KEYWORDS
  4901.   #define    const                /* delete ANSI C keywords */
  4902.   #define    inline
  4903.   #define    signed
  4904.   #define    volatile
  4905. + #endif
  4906.   #endif    /* !__GNUC__ */
  4907.   #endif    /* !(__STDC__ || __cplusplus) */
  4908.   
  4909.   /*
  4910. !  * GCC1 and some versions of GCC2 declare dead (non-returning) and
  4911. !  * pure (no side effects) functions using "volatile" and "const";
  4912. !  * unfortunately, these then cause warnings under "-ansi -pedantic".
  4913. !  * GCC2 uses a new, peculiar __attribute__((attrs)) style.  All of
  4914. !  * these work for GNU C++ (modulo a slight glitch in the C++ grammar
  4915. !  * in the distribution version of 2.5.5).
  4916.    */
  4917. + #if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5
  4918. + #define    __attribute__(x)    /* delete __attribute__ if non-gcc or gcc1 */
  4919.   #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
  4920. ! #define    __dead        __volatile
  4921. ! #define    __pure        __const
  4922. ! #endif
  4923. ! #endif
  4924. ! /* Delete pseudo-keywords wherever they are not available or needed. */
  4925. ! #ifndef __dead
  4926. ! #define    __dead
  4927. ! #define    __pure
  4928.   #endif
  4929.   
  4930.   #endif /* !_CDEFS_H_ */
  4931. *** src/clock.c.OLD    Sun Oct 24 13:47:32 1993
  4932. --- src/clock.c    Wed Jan 12 06:00:02 1994
  4933. ***************
  4934. *** 33,39 ****
  4935.    */
  4936.   
  4937.   #ifndef lint
  4938. ! static char sccsid[] = "@(#)clock.c    8.7 (Berkeley) 10/21/93";
  4939.   #endif /* not lint */
  4940.   
  4941.   # include "sendmail.h"
  4942. --- 33,39 ----
  4943.    */
  4944.   
  4945.   #ifndef lint
  4946. ! static char sccsid[] = "@(#)clock.c    8.8 (Berkeley) 1/12/94";
  4947.   #endif /* not lint */
  4948.   
  4949.   # include "sendmail.h"
  4950. ***************
  4951. *** 60,66 ****
  4952.   **        none.
  4953.   */
  4954.   
  4955. ! static void tick();
  4956.   
  4957.   EVENT *
  4958.   setevent(intvl, func, arg)
  4959. --- 60,66 ----
  4960.   **        none.
  4961.   */
  4962.   
  4963. ! static void tick __P((int));
  4964.   
  4965.   EVENT *
  4966.   setevent(intvl, func, arg)
  4967. ***************
  4968. *** 101,107 ****
  4969.           printf("setevent: intvl=%ld, for=%ld, func=%x, arg=%d, ev=%x\n",
  4970.               intvl, now + intvl, func, arg, ev);
  4971.   
  4972. !     tick();
  4973.       return (ev);
  4974.   }
  4975.    /*
  4976. --- 101,107 ----
  4977.           printf("setevent: intvl=%ld, for=%ld, func=%x, arg=%d, ev=%x\n",
  4978.               intvl, now + intvl, func, arg, ev);
  4979.   
  4980. !     tick(0);
  4981.       return (ev);
  4982.   }
  4983.    /*
  4984. ***************
  4985. *** 143,149 ****
  4986.       }
  4987.   
  4988.       /* restore clocks and pick up anything spare */
  4989. !     tick();
  4990.   }
  4991.    /*
  4992.   **  TICK -- take a clock tick
  4993. --- 143,149 ----
  4994.       }
  4995.   
  4996.       /* restore clocks and pick up anything spare */
  4997. !     tick(0);
  4998.   }
  4999.    /*
  5000.   **  TICK -- take a clock tick
  5001. ***************
  5002. *** 151,157 ****
  5003.   **    Called by the alarm clock.  This routine runs events as needed.
  5004.   **
  5005.   **    Parameters:
  5006. ! **        none.
  5007.   **
  5008.   **    Returns:
  5009.   **        none.
  5010. --- 151,157 ----
  5011.   **    Called by the alarm clock.  This routine runs events as needed.
  5012.   **
  5013.   **    Parameters:
  5014. ! **        One that is ignored; for compatibility with signal handlers.
  5015.   **
  5016.   **    Returns:
  5017.   **        none.
  5018. ***************
  5019. *** 161,167 ****
  5020.   */
  5021.   
  5022.   static void
  5023. ! tick()
  5024.   {
  5025.       register time_t now;
  5026.       register EVENT *ev;
  5027. --- 161,168 ----
  5028.   */
  5029.   
  5030.   static void
  5031. ! tick(arg)
  5032. !     int arg;
  5033.   {
  5034.       register time_t now;
  5035.       register EVENT *ev;
  5036. *** src/collect.c.OLD    Wed Nov 17 16:29:54 1993
  5037. --- src/collect.c    Sat Jan  8 17:29:31 1994
  5038. ***************
  5039. *** 33,39 ****
  5040.    */
  5041.   
  5042.   #ifndef lint
  5043. ! static char sccsid[] = "@(#)collect.c    8.6 (Berkeley) 10/27/93";
  5044.   #endif /* not lint */
  5045.   
  5046.   # include <errno.h>
  5047. --- 33,39 ----
  5048.    */
  5049.   
  5050.   #ifndef lint
  5051. ! static char sccsid[] = "@(#)collect.c    8.8 (Berkeley) 1/8/94";
  5052.   #endif /* not lint */
  5053.   
  5054.   # include <errno.h>
  5055. ***************
  5056. *** 160,166 ****
  5057.               if (sfgets(freebuf, MAXLINE, InChannel,
  5058.                       TimeOuts.to_datablock,
  5059.                       "message header read") == NULL)
  5060. !                 goto readerr;
  5061.   
  5062.               /* is this a continuation line? */
  5063.               if (*freebuf != ' ' && *freebuf != '\t')
  5064. --- 160,169 ----
  5065.               if (sfgets(freebuf, MAXLINE, InChannel,
  5066.                       TimeOuts.to_datablock,
  5067.                       "message header read") == NULL)
  5068. !             {
  5069. !                 freebuf[0] = '\0';
  5070. !                 break;
  5071. !             }
  5072.   
  5073.               /* is this a continuation line? */
  5074.               if (*freebuf != ' ' && *freebuf != '\t')
  5075. ***************
  5076. *** 257,263 ****
  5077.               break;
  5078.   
  5079.           /* check for transparent dot */
  5080. !         if (OpMode == MD_SMTP && bp[0] == '.' && bp[1] == '.')
  5081.               bp++;
  5082.   
  5083.           /*
  5084. --- 260,267 ----
  5085.               break;
  5086.   
  5087.           /* check for transparent dot */
  5088. !         if ((OpMode == MD_SMTP || OpMode == MD_DAEMON) &&
  5089. !             bp[0] == '.' && bp[1] == '.')
  5090.               bp++;
  5091.   
  5092.           /*
  5093. ***************
  5094. *** 278,283 ****
  5095. --- 282,289 ----
  5096.       if (feof(InChannel) || ferror(InChannel))
  5097.       {
  5098.   readerr:
  5099. +         if (tTd(30, 1))
  5100. +             printf("collect: read error\n");
  5101.           inputerr = TRUE;
  5102.       }
  5103.   
  5104. ***************
  5105. *** 290,296 ****
  5106.       }
  5107.   
  5108.       /* An EOF when running SMTP is an error */
  5109. !     if (inputerr && OpMode == MD_SMTP)
  5110.       {
  5111.           char *host;
  5112.           char *problem;
  5113. --- 296,302 ----
  5114.       }
  5115.   
  5116.       /* An EOF when running SMTP is an error */
  5117. !     if (inputerr && (OpMode == MD_SMTP || OpMode == MD_DAEMON))
  5118.       {
  5119.           char *host;
  5120.           char *problem;
  5121. *** src/conf.c.OLD    Sun Nov  7 14:05:27 1993
  5122. --- src/conf.c    Tue Jan 11 07:04:01 1994
  5123. ***************
  5124. *** 33,39 ****
  5125.    */
  5126.   
  5127.   #ifndef lint
  5128. ! static char sccsid[] = "@(#)conf.c    8.42 (Berkeley) 10/21/93";
  5129.   #endif /* not lint */
  5130.   
  5131.   # include "sendmail.h"
  5132. --- 33,39 ----
  5133.    */
  5134.   
  5135.   #ifndef lint
  5136. ! static char sccsid[] = "@(#)conf.c    8.62 (Berkeley) 1/9/94";
  5137.   #endif /* not lint */
  5138.   
  5139.   # include "sendmail.h"
  5140. ***************
  5141. *** 40,45 ****
  5142. --- 40,46 ----
  5143.   # include "pathnames.h"
  5144.   # include <sys/ioctl.h>
  5145.   # include <sys/param.h>
  5146. + # include <netdb.h>
  5147.   # include <pwd.h>
  5148.   
  5149.   /*
  5150. ***************
  5151. *** 597,603 ****
  5152.   # include    <compat.h>
  5153.   #endif
  5154.   
  5155. ! init_md()
  5156.   {
  5157.   #ifdef _AUX_SOURCE
  5158.       setcompat(getcompat() | COMPAT_BSDPROT);
  5159. --- 598,606 ----
  5160.   # include    <compat.h>
  5161.   #endif
  5162.   
  5163. ! init_md(argc, argv)
  5164. !     int argc;
  5165. !     char **argv;
  5166.   {
  5167.   #ifdef _AUX_SOURCE
  5168.       setcompat(getcompat() | COMPAT_BSDPROT);
  5169. ***************
  5170. *** 792,801 ****
  5171.   #if LA_TYPE == LA_MACH
  5172.   
  5173.   /*
  5174. ! **  This has been tested on NeXT release 2.1.
  5175.   */
  5176.   
  5177. ! #include <mach.h>
  5178.   
  5179.   getla()
  5180.   {
  5181. --- 795,808 ----
  5182.   #if LA_TYPE == LA_MACH
  5183.   
  5184.   /*
  5185. ! **  This has been tested on NEXTSTEP release 2.1/3.X.
  5186.   */
  5187.   
  5188. ! #if defined(NX_CURRENT_COMPILER_RELEASE) && NX_CURRENT_COMPILER_RELEASE > NX_COMPILER_RELEASE_3_0
  5189. ! # include <mach/mach.h>
  5190. ! #else
  5191. ! # include <mach.h>
  5192. ! #endif
  5193.   
  5194.   getla()
  5195.   {
  5196. ***************
  5197. *** 910,915 ****
  5198. --- 917,923 ----
  5199.   #  include <sys/exec.h>
  5200.   #  ifdef __bsdi__
  5201.   #   undef PS_STRINGS    /* BSDI 1.0 doesn't do PS_STRINGS as we expect */
  5202. + #   define PROCTITLEPAD    '\0'
  5203.   #  endif
  5204.   #  ifdef PS_STRINGS
  5205.   #   define SETPROC_STATIC static
  5206. ***************
  5207. *** 920,925 ****
  5208. --- 928,937 ----
  5209.   # endif
  5210.   #endif
  5211.   
  5212. + #ifndef PROCTITLEPAD
  5213. + # define PROCTITLEPAD    ' '
  5214. + #endif
  5215.   /*VARARGS1*/
  5216.   #ifdef __STDC__
  5217.   setproctitle(char *fmt, ...)
  5218. ***************
  5219. *** 969,975 ****
  5220.       (void) strcpy(Argv[0], buf);
  5221.       p = &Argv[0][i];
  5222.       while (p < LastArgv)
  5223. !         *p++ = ' ';
  5224.   #   endif
  5225.   #  endif
  5226.   # endif /* SETPROCTITLE */
  5227. --- 981,987 ----
  5228.       (void) strcpy(Argv[0], buf);
  5229.       p = &Argv[0][i];
  5230.       while (p < LastArgv)
  5231. !         *p++ = PROCTITLEPAD;
  5232.   #   endif
  5233.   #  endif
  5234.   # endif /* SETPROCTITLE */
  5235. ***************
  5236. *** 1258,1266 ****
  5237.   /*
  5238.    * get option letter from argument vector
  5239.    */
  5240. ! int    opterr = 1,        /* if error message should be printed */
  5241. !     optind = 1,        /* index into parent argv vector */
  5242. !     optopt;            /* character checked for validity */
  5243.   char    *optarg;        /* argument associated with option */
  5244.   
  5245.   #define BADCH    (int)'?'
  5246. --- 1270,1282 ----
  5247.   /*
  5248.    * get option letter from argument vector
  5249.    */
  5250. ! #ifdef _CONVEX_SOURCE
  5251. ! extern int    optind, opterr;
  5252. ! #else
  5253. ! int    opterr = 1;        /* if error message should be printed */
  5254. ! int    optind = 1;        /* index into parent argv vector */
  5255. ! #endif
  5256. ! int    optopt;            /* character checked for validity */
  5257.   char    *optarg;        /* argument associated with option */
  5258.   
  5259.   #define BADCH    (int)'?'
  5260. ***************
  5261. *** 1269,1277 ****
  5262.           fputc(optopt,stderr);fputc('\n',stderr);return(BADCH);}
  5263.   
  5264.   getopt(nargc,nargv,ostr)
  5265. ! int    nargc;
  5266. ! char    **nargv,
  5267. !     *ostr;
  5268.   {
  5269.       static char    *place = EMSG;    /* option letter processing */
  5270.       static char    atend = 0;
  5271. --- 1285,1293 ----
  5272.           fputc(optopt,stderr);fputc('\n',stderr);return(BADCH);}
  5273.   
  5274.   getopt(nargc,nargv,ostr)
  5275. !     int        nargc;
  5276. !     char *const    *nargv;
  5277. !     const char    *ostr;
  5278.   {
  5279.       static char    *place = EMSG;    /* option letter processing */
  5280.       static char    atend = 0;
  5281. ***************
  5282. *** 1356,1361 ****
  5283. --- 1372,1468 ----
  5284.   
  5285.   #endif
  5286.    /*
  5287. + **  USERSHELLOK -- tell if a user's shell is ok for unrestricted use
  5288. + **
  5289. + **    Parameters:
  5290. + **        shell -- the user's shell from /etc/passwd
  5291. + **
  5292. + **    Returns:
  5293. + **        TRUE -- if it is ok to use this for unrestricted access.
  5294. + **        FALSE -- if the shell is restricted.
  5295. + */
  5296. + #if !HASGETUSERSHELL
  5297. + # ifndef _PATH_SHELLS
  5298. + #  define _PATH_SHELLS    "/etc/shells"
  5299. + # endif
  5300. + char    *DefaultUserShells[] =
  5301. + {
  5302. +     "/bin/sh",
  5303. +     "/usr/bin/sh",
  5304. +     "/bin/csh",
  5305. +     "/usr/bin/csh",
  5306. + #ifdef __hpux
  5307. +     "/bin/rsh",
  5308. +     "/bin/ksh",
  5309. +     "/bin/rksh",
  5310. +     "/bin/pam",
  5311. +     "/usr/bin/keysh",
  5312. +     "/bin/posix/sh",
  5313. + #endif
  5314. +     NULL
  5315. + };
  5316. + #endif
  5317. + bool
  5318. + usershellok(shell)
  5319. +     char *shell;
  5320. + {
  5321. + #if HASGETUSERSHELL
  5322. +     register char *p;
  5323. +     extern char *getusershell();
  5324. +     setusershell();
  5325. +     while ((p = getusershell()) != NULL)
  5326. +         if (strcmp(p, shell) == 0 || strcmp(p, "*") == 0)
  5327. +             break;
  5328. +     endusershell();
  5329. +     return p != NULL;
  5330. + #else
  5331. +     register FILE *shellf;
  5332. +     char buf[MAXLINE];
  5333. +     shellf = fopen(_PATH_SHELLS, "r");
  5334. +     if (shellf == NULL)
  5335. +     {
  5336. +         /* no /etc/shells; see if it is one of the std shells */
  5337. +         char **d;
  5338. +         for (d = DefaultUserShells; *d != NULL; d++)
  5339. +         {
  5340. +             if (strcmp(shell, *d) == 0)
  5341. +                 return TRUE;
  5342. +         }
  5343. +         return FALSE;
  5344. +     }
  5345. +     while (fgets(buf, sizeof buf, shellf) != NULL)
  5346. +     {
  5347. +         register char *p, *q;
  5348. +         p = buf;
  5349. +         while (*p != '\0' && *p != '#' && *p != '/')
  5350. +             p++;
  5351. +         if (*p == '#' || *p == '\0')
  5352. +             continue;
  5353. +         q = p;
  5354. +         while (*p != '\0' && *p != '#' && !isspace(*p))
  5355. +             p++;
  5356. +         *p = '\0';
  5357. +         if (strcmp(shell, q) == 0 || strcmp("*", q) == 0)
  5358. +         {
  5359. +             fclose(shellf);
  5360. +             return TRUE;
  5361. +         }
  5362. +     }
  5363. +     fclose(shellf);
  5364. +     return FALSE;
  5365. + #endif
  5366. + }
  5367. +  /*
  5368.   **  FREESPACE -- see how much free space is on the queue filesystem
  5369.   **
  5370.   **    Only implemented if you have statfs.
  5371. ***************
  5372. *** 1382,1391 ****
  5373.   #endif
  5374.   
  5375.   #ifdef HASSTATFS
  5376. ! # if defined(IRIX) || defined(apollo) || defined(_SCO_unix_) || defined(UMAXV) || defined(DGUX)
  5377.   #  include <sys/statfs.h>
  5378.   # else
  5379. ! #  if (defined(sun) && !defined(BSD)) || defined(__hpux) || defined(_CONVEX_SOURCE) || defined(NeXT) || defined(_AUX_SOURCE)
  5380.   #   include <sys/vfs.h>
  5381.   #  else
  5382.   #   include <sys/mount.h>
  5383. --- 1489,1498 ----
  5384.   #endif
  5385.   
  5386.   #ifdef HASSTATFS
  5387. ! # if defined(IRIX) || defined(apollo) || defined(_SCO_unix_) || defined(UMAXV) || defined(DGUX) || defined(_AIX3)
  5388.   #  include <sys/statfs.h>
  5389.   # else
  5390. ! #  if (defined(sun) && !defined(BSD)) || defined(__hpux) || defined(_CONVEX_SOURCE) || defined(NeXT) || defined(_AUX_SOURCE) || defined(MACH386)
  5391.   #   include <sys/vfs.h>
  5392.   #  else
  5393.   #   include <sys/mount.h>
  5394. ***************
  5395. *** 1726,1731 ****
  5396. --- 1833,1848 ----
  5397.   {
  5398.       if (ConfFile != NULL)
  5399.           return ConfFile;
  5400. + #ifdef NETINFO
  5401. +     {
  5402. +         extern char *ni_propval();
  5403. +         char *cflocation;
  5404. +         cflocation = ni_propval("/locations/sendmail", "sendmail.cf");
  5405. +         if (cflocation != NULL)
  5406. +             return cflocation;
  5407. +     }
  5408. + #endif
  5409.       return _PATH_SENDMAILCF;
  5410.   }
  5411.    /*
  5412. ***************
  5413. *** 1737,1742 ****
  5414. --- 1854,1865 ----
  5415.   **    Returns:
  5416.   **        TRUE -- if ok.
  5417.   **        FALSE -- if vendor code could not be processed.
  5418. + **
  5419. + **    Side Effects:
  5420. + **        It is reasonable to set mode flags here to tweak
  5421. + **        processing in other parts of the code if necessary.
  5422. + **        For example, if you are a vendor that uses $%y to
  5423. + **        indicate YP lookups, you could enable that here.
  5424.   */
  5425.   
  5426.   bool
  5427. ***************
  5428. *** 1743,1747 ****
  5429.   setvendor(vendor)
  5430.       char *vendor;
  5431.   {
  5432. !     return (strcasecmp(vendor, "Berkeley") == 0);
  5433.   }
  5434. --- 1866,2115 ----
  5435.   setvendor(vendor)
  5436.       char *vendor;
  5437.   {
  5438. !     if (strcasecmp(vendor, "Berkeley") == 0)
  5439. !         return TRUE;
  5440. !     /* add vendor extensions here */
  5441. !     return FALSE;
  5442.   }
  5443. +  /*
  5444. + **  STRTOL -- convert string to long integer
  5445. + **
  5446. + **    For systems that don't have it in the C library.
  5447. + */
  5448. + #ifdef NEEDSTRTOL
  5449. + long
  5450. + strtol(p, ep, b)
  5451. +     char *p;
  5452. +     char **ep;
  5453. +     int b;
  5454. + {
  5455. +     long l = 0;
  5456. +     char c;
  5457. +     char maxd;
  5458. +     int neg = 1;
  5459. +     maxd = (b > 10) ? '9' : b + '0';
  5460. +     if (p && *p == '-') {
  5461. +         neg = -1;
  5462. +         p++;
  5463. +     }
  5464. +     while (p && (c = *p)) {
  5465. +         if (c >= '0' && c <= maxd) {
  5466. +             l = l*b + *p++ - '0';
  5467. +             continue;
  5468. +         }
  5469. +         if (c >= 'A' && c <= 'Z')
  5470. +             c -= 'A' + 'a';
  5471. +         c = c - 'a' + 10;
  5472. +         if (b > c) {
  5473. +             l = l*b + c;
  5474. +             p++;
  5475. +             continue;
  5476. +         }
  5477. +         break;
  5478. +     }
  5479. +     l *= neg;
  5480. +     if (ep)
  5481. +         *ep = p;
  5482. +     return l;
  5483. + }
  5484. + #endif
  5485. +  /*
  5486. + **  SOLARIS_GETHOSTBY{NAME,ADDR} -- compatibility routines for gethostbyXXX
  5487. + **
  5488. + **    Solaris versions prior through 2.3 don't properly deliver a
  5489. + **    canonical h_name field.  This tries to work around it.
  5490. + */
  5491. + #ifdef SOLARIS
  5492. + struct hostent *
  5493. + solaris_gethostbyname(name)
  5494. +     const char *name;
  5495. + {
  5496. + # ifdef SOLARIS_2_3
  5497. +     static struct hostent hp;
  5498. +     static char buf[1000];
  5499. +     extern struct hostent *_switch_gethostbyname_r();
  5500. +     return _switch_gethostbyname_r(name, &hp, buf, sizeof(buf), &h_errno);
  5501. + # else
  5502. +     extern struct hostent *__switch_gethostbyname();
  5503. +     return __switch_gethostbyname(name);
  5504. + # endif
  5505. + }
  5506. + struct hostent *
  5507. + solaris_gethostbyaddr(addr, len, type)
  5508. +     const char *addr;
  5509. +     int len;
  5510. +     int type;
  5511. + {
  5512. + # ifdef SOLARIS_2_3
  5513. +     static struct hostent hp;
  5514. +     static char buf[1000];
  5515. +     extern struct hostent *_switch_gethostbyaddr_r();
  5516. +     return _switch_gethostbyaddr_r(addr, len, type, &hp, buf, sizeof(buf), &h_errno);
  5517. + # else
  5518. +     extern struct hostent *__switch_gethostbyaddr();
  5519. +     return __switch_gethostbyaddr(addr, len, type);
  5520. + # endif
  5521. + }
  5522. + #endif
  5523. +  /*
  5524. + **  NI_PROPVAL -- netinfo property value lookup routine
  5525. + **
  5526. + **    Parameters:
  5527. + **        directory -- the Netinfo directory name.
  5528. + **        propname -- the Netinfo property name.
  5529. + **
  5530. + **    Returns:
  5531. + **        NULL -- if:
  5532. + **            1. the directory is not found
  5533. + **            2. the property name is not found
  5534. + **            3. the property contains multiple values
  5535. + **            4. some error occured
  5536. + **        else -- the location of the config file.
  5537. + **
  5538. + **    Notes:
  5539. + **          Caller should free the return value of ni_proval
  5540. + */
  5541. + #ifdef NETINFO
  5542. + # include <netinfo/ni.h>
  5543. + # define LOCAL_NETINFO_DOMAIN    "."
  5544. + # define PARENT_NETINFO_DOMAIN   ".."
  5545. + # define MAX_NI_LEVELS           256
  5546. + char *
  5547. + ni_propval(directory, propname)
  5548. +     char *directory;
  5549. +     char *propname;
  5550. + {
  5551. +     char *propval;
  5552. +     int i;
  5553. +     void *ni = NULL;
  5554. +     void *lastni = NULL;
  5555. +     ni_status nis;
  5556. +     ni_id nid;
  5557. +     ni_namelist ninl;
  5558. +     /*
  5559. +     **  If the passed directory and property name are found
  5560. +     **  in one of netinfo domains we need to search (starting
  5561. +     **  from the local domain moving all the way back to the
  5562. +     **  root domain) set propval to the property's value
  5563. +     **  and return it.
  5564. +     */
  5565. +     for (i = 0; i < MAX_NI_LEVELS; ++i)
  5566. +     {
  5567. +         if (i == 0)
  5568. +         {
  5569. +             nis = ni_open(NULL, LOCAL_NETINFO_DOMAIN, &ni);
  5570. +         }
  5571. +         else
  5572. +         {
  5573. +             if (lastni != NULL)
  5574. +                 ni_free(lastni);
  5575. +             lastni = ni;
  5576. +             nis = ni_open(lastni, PARENT_NETINFO_DOMAIN, &ni);
  5577. +         }
  5578. +         /*
  5579. +         **  Don't bother if we didn't get a handle on a
  5580. +         **  proper domain.  This is not necessarily an error.
  5581. +         **  We would get a positive ni_status if, for instance
  5582. +         **  we never found the directory or property and tried
  5583. +         **  to open the parent of the root domain!
  5584. +         */
  5585. +         if (nis != 0)
  5586. +             break;
  5587. +         /*
  5588. +         **  Find the path to the server information.
  5589. +         */
  5590. +         if (ni_pathsearch(ni, &nid, directory) != 0)
  5591. +             continue;
  5592. +         /*
  5593. +         **  Find "host" information.
  5594. +         */
  5595. +         if (ni_lookupprop(ni, &nid, propname, &ninl) != 0)
  5596. +             continue;
  5597. +         /*
  5598. +         **  If there's only one name in
  5599. +         **  the list, assume we've got
  5600. +         **  what we want.
  5601. +         */
  5602. +         if (ninl.ni_namelist_len == 1)
  5603. +         {
  5604. +             propval = ni_name_dup(ninl.ni_namelist_val[0]);
  5605. +             break;
  5606. +         }
  5607. +     }
  5608. +     /*
  5609. +     **  Clean up.
  5610. +     */
  5611. +     if (ni != NULL)
  5612. +         ni_free(ni);
  5613. +     if (lastni != NULL && ni != lastni)
  5614. +         ni_free(lastni);
  5615. +     return propval;
  5616. + }
  5617. + #endif /* NETINFO */
  5618. +  /*
  5619. + **  HARD_SYSLOG -- call syslog repeatedly until it works
  5620. + **
  5621. + **    Needed on HP-UX, which apparently doesn't guarantee that
  5622. + **    syslog succeeds during interrupt handlers.
  5623. + */
  5624. + #ifdef __hpux
  5625. + # define MAXSYSLOGTRIES    100
  5626. + # undef syslog
  5627. + # ifdef __STDC__
  5628. + hard_syslog(int pri, char *msg, ...)
  5629. + # else
  5630. + hard_syslog(pri, msg, va_alist)
  5631. +     int pri;
  5632. +     char *msg;
  5633. +     va_dcl
  5634. + # endif
  5635. + {
  5636. +     int i;
  5637. +     char buf[SYSLOG_BUFSIZE * 2];
  5638. +     VA_LOCAL_DECL;
  5639. +     VA_START(msg);
  5640. +     vsprintf(buf, msg, ap);
  5641. +     VA_END;
  5642. +     for (i = MAXSYSLOGTRIES; --i >= 0 && syslog(pri, "%s", buf) < 0; )
  5643. +         continue;
  5644. + }
  5645. + #endif
  5646. *** src/conf.h.OLD    Sun Nov  7 10:37:02 1993
  5647. --- src/conf.h    Sat Jan  8 17:53:13 1994
  5648. ***************
  5649. *** 31,37 ****
  5650.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  5651.    * SUCH DAMAGE.
  5652.    *
  5653. !  *    @(#)conf.h    8.44 (Berkeley) 10/29/93
  5654.    */
  5655.   
  5656.   /*
  5657. --- 31,37 ----
  5658.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  5659.    * SUCH DAMAGE.
  5660.    *
  5661. !  *    @(#)conf.h    8.75 (Berkeley) 1/8/94
  5662.    */
  5663.   
  5664.   /*
  5665. ***************
  5666. *** 64,70 ****
  5667.   # define MEMCHUNKSIZE    1024        /* chunk size for memory allocation */
  5668.   # define MAXUSERENVIRON    100        /* max envars saved, must be >= 3 */
  5669.   # define MAXALIASDB    12        /* max # of alias databases */
  5670. - # define PSBUFSIZE    (MAXLINE + MAXATOM)    /* size of prescan buffer */
  5671.   
  5672.   # ifndef QUEUESIZE
  5673.   # define QUEUESIZE    1000        /* max # of jobs per queue run */
  5674. --- 64,69 ----
  5675. ***************
  5676. *** 78,83 ****
  5677. --- 77,83 ----
  5678.   
  5679.   # define LOG        1    /* enable logging */
  5680.   # define UGLYUUCP    1    /* output ugly UUCP From lines */
  5681. + # define NETUNIX    1    /* include unix domain support */
  5682.   # define NETINET    1    /* include internet support */
  5683.   # define SETPROCTITLE    1    /* munge argv to display current status */
  5684.   # define NAMED_BIND    1    /* use Berkeley Internet Domain Server */
  5685. ***************
  5686. *** 89,106 ****
  5687.   # endif
  5688.   
  5689.   /*
  5690. ! **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
  5691. ! **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
  5692. ! **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
  5693. ! **  are closed.  Some firewalls return this error if you try to connect
  5694. ! **  to the IDENT port (113), so you can't receive email from these hosts
  5695. ! **  on these systems.  The firewall really should use a more specific
  5696. ! **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  This
  5697. ! **  will get #undefed below as needed.
  5698.   */
  5699.   
  5700. ! # define IDENTPROTO    1    /* use IDENT proto (RFC 1413) */
  5701.   
  5702.   /**********************************************************************
  5703.   **  Operating system configuration.
  5704.   **
  5705. --- 89,115 ----
  5706.   # endif
  5707.   
  5708.   /*
  5709. ! **  Most systems have symbolic links today, so default them on.  You
  5710. ! **  can turn them off by #undef'ing this below.
  5711.   */
  5712.   
  5713. ! # define HASLSTAT    1    /* has lstat(2) call */
  5714.   
  5715. + /*
  5716. + **  General "standard C" defines.
  5717. + **
  5718. + **    These may be undone later, to cope with systems that claim to
  5719. + **    be Standard C but aren't.  Gcc is the biggest offender -- it
  5720. + **    doesn't realize that the library is part of the language.
  5721. + **
  5722. + **    Life would be much easier if we could get rid of this sort
  5723. + **    of bozo problems.
  5724. + */
  5725. + #ifdef __STDC__
  5726. + # define HASSETVBUF    1    /* we have setvbuf(3) in libc */
  5727. + #endif
  5728.   /**********************************************************************
  5729.   **  Operating system configuration.
  5730.   **
  5731. ***************
  5732. *** 114,120 ****
  5733.   
  5734.   
  5735.   /*
  5736. ! **  HP-UX -- tested for 8.07
  5737.   */
  5738.   
  5739.   # ifdef __hpux
  5740. --- 123,129 ----
  5741.   
  5742.   
  5743.   /*
  5744. ! **  HP-UX -- tested for 8.07, 9.00, and 9.01.
  5745.   */
  5746.   
  5747.   # ifdef __hpux
  5748. ***************
  5749. *** 126,134 ****
  5750.   # define HASSETREUID    1    /* has setreuid(2) call */
  5751.   # define setreuid(r, e)        setresuid(r, e, -1)    
  5752.   # define LA_TYPE    LA_FLOAT
  5753.   # define _PATH_UNIX    "/hp-ux"
  5754. ! # undef IDENTPROTO        /* TCP/IP implementation is broken */
  5755.   # endif
  5756.   
  5757.   
  5758.   /*
  5759. --- 135,156 ----
  5760.   # define HASSETREUID    1    /* has setreuid(2) call */
  5761.   # define setreuid(r, e)        setresuid(r, e, -1)    
  5762.   # define LA_TYPE    LA_FLOAT
  5763. + # define GIDSET_T    gid_t
  5764.   # define _PATH_UNIX    "/hp-ux"
  5765. ! # ifndef _PATH_SENDMAILCF
  5766. ! #  define _PATH_SENDMAILCF    "/usr/lib/sendmail.cf"
  5767.   # endif
  5768. + # ifndef IDENTPROTO
  5769. + #  define IDENTPROTO    0    /* TCP/IP implementation is broken */
  5770. + # endif
  5771. + # ifndef HASGETUSERSHELL
  5772. + #  define HASGETUSERSHELL 0    /* getusershell(3) causes core dumps */
  5773. + # endif
  5774. + # define syslog        hard_syslog
  5775. + # ifdef __STDC__
  5776. + extern int    syslog(int, char *, ...);
  5777. + # endif
  5778. + # endif
  5779.   
  5780.   
  5781.   /*
  5782. ***************
  5783. *** 137,142 ****
  5784. --- 159,167 ----
  5785.   
  5786.   # ifdef _AIX3
  5787.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  5788. + # define HASSTATFS    1    /* has the statfs(2) syscall */
  5789. + # define HASUNAME    1    /* use System V uname(2) system call */
  5790. + # define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
  5791.   # define FORK        fork    /* no vfork primitive available */
  5792.   # undef  SETPROCTITLE        /* setproctitle confuses AIX */
  5793.   # endif
  5794. ***************
  5795. *** 153,158 ****
  5796. --- 178,184 ----
  5797.   # define HASSETREUID    1    /* has setreuid(2) call */
  5798.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  5799.   # define HASSTATFS    1    /* has the statfs(2) syscall */
  5800. + # define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
  5801.   # define FORK        fork    /* no vfork primitive available */
  5802.   # define WAITUNION    1    /* use "union wait" as wait argument type */
  5803.   # define setpgid    BSDsetpgrp
  5804. ***************
  5805. *** 161,184 ****
  5806.   
  5807.   
  5808.   /*
  5809. ! **  SunOS
  5810.   */
  5811.   
  5812.   #if defined(sun) && !defined(BSD)
  5813.   
  5814.   # define LA_TYPE    LA_INT
  5815. - # define HASSETREUID    1    /* has setreuid(2) call */
  5816.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  5817.   
  5818.   # ifdef SOLARIS
  5819.               /* Solaris 2.x (a.k.a. SunOS 5.x) */
  5820. ! #  define SYSTEM5    1    /* use System V definitions */
  5821. ! #  define setreuid(r, e)    seteuid(e)
  5822. ! #  include <sys/sysmacros.h>
  5823.   #  include <sys/time.h>
  5824. ! #  define gethostbyname    __switch_gethostbyname    /* get working version */
  5825. ! #  define gethostbyaddr    __switch_gethostbyaddr    /* get working version */
  5826. ! #  define _PATH_UNIX    "/kernel/unix"
  5827.   #  ifndef _PATH_SENDMAILCF
  5828.   #   define _PATH_SENDMAILCF    "/etc/mail/sendmail.cf"
  5829.   #  endif
  5830. --- 187,221 ----
  5831.   
  5832.   
  5833.   /*
  5834. ! **  SunOS and Solaris
  5835. ! **
  5836. ! **    Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
  5837. ! **    Solaris 2.2 (a.k.a. SunOS 5.2).
  5838.   */
  5839.   
  5840.   #if defined(sun) && !defined(BSD)
  5841.   
  5842.   # define LA_TYPE    LA_INT
  5843.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  5844. + # define HASUNAME    1    /* use System V uname(2) system call */
  5845. + # define HASGETUSERSHELL 1    /* DOES have getusershell(3) call in libc */
  5846.   
  5847. + # ifdef SOLARIS_2_3
  5848. + #  define SOLARIS
  5849. + # endif
  5850.   # ifdef SOLARIS
  5851.               /* Solaris 2.x (a.k.a. SunOS 5.x) */
  5852. ! #  ifndef __svr4__
  5853. ! #   define __svr4__        /* use all System V Releae 4 defines below */
  5854. ! #  endif
  5855.   #  include <sys/time.h>
  5856. ! #  define gethostbyname    solaris_gethostbyname    /* get working version */
  5857. ! #  define gethostbyaddr    solaris_gethostbyaddr    /* get working version */
  5858. ! #  define GIDSET_T    gid_t
  5859. ! #  ifndef _PATH_UNIX
  5860. ! #   define _PATH_UNIX    "/kernel/unix"
  5861. ! #  endif
  5862.   #  ifndef _PATH_SENDMAILCF
  5863.   #   define _PATH_SENDMAILCF    "/etc/mail/sendmail.cf"
  5864.   #  endif
  5865. ***************
  5866. *** 187,202 ****
  5867.   #  endif
  5868.   
  5869.   # else
  5870. !             /* SunOS 4.1.x */
  5871.   #  define HASSTATFS    1    /* has the statfs(2) syscall */
  5872. ! /* #  define HASFLOCK    1    /* has flock(2) call */
  5873.   #  include <vfork.h>
  5874.   
  5875.   # endif
  5876.   #endif
  5877.   
  5878.   /*
  5879. ! ** DG/UX 5.4.2
  5880.   */
  5881.   
  5882.   #ifdef    DGUX
  5883. --- 224,255 ----
  5884.   #  endif
  5885.   
  5886.   # else
  5887. !             /* SunOS 4.0.3 or 4.1.x */
  5888. ! #  define HASSETREUID    1    /* has setreuid(2) call */
  5889.   #  define HASSTATFS    1    /* has the statfs(2) syscall */
  5890. ! #  define HASFLOCK    1    /* has flock(2) call */
  5891.   #  include <vfork.h>
  5892.   
  5893. + #  ifdef SUNOS403
  5894. +             /* special tweaking for SunOS 4.0.3 */
  5895. + #   include <malloc.h>
  5896. + #   define SYS5SIGNALS    1    /* SysV signal semantics -- reset on each sig */
  5897. + #   define WAITUNION    1    /* use "union wait" as wait argument type */
  5898. + #   undef WIFEXITED
  5899. + #   undef WEXITSTATUS
  5900. + #   undef HASUNAME
  5901. + #   define setpgid    setpgrp
  5902. + typedef int        pid_t;
  5903. + extern char        *getenv();
  5904. + #  endif
  5905.   # endif
  5906.   #endif
  5907.   
  5908.   /*
  5909. ! **  DG/UX
  5910. ! **
  5911. ! **    Tested on 5.4.2
  5912.   */
  5913.   
  5914.   #ifdef    DGUX
  5915. ***************
  5916. *** 207,215 ****
  5917.   # define HASUNAME    1    /* use System V uname(2) system call */
  5918.   # define HASSETSID    1    /* has Posix setsid(2) call */
  5919.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  5920. ! # define HASSETVBUF    1    /* we have setvbuf(3) in libc */
  5921. ! # undef IDENTPROTO        /* TCP/IP implementation is broken */
  5922.   # undef SETPROCTITLE
  5923.   # define inet_addr    dgux_inet_addr
  5924.   extern long    dgux_inet_addr();
  5925.   #endif
  5926. --- 260,274 ----
  5927.   # define HASUNAME    1    /* use System V uname(2) system call */
  5928.   # define HASSETSID    1    /* has Posix setsid(2) call */
  5929.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  5930. ! # ifndef IDENTPROTO
  5931. ! #  define IDENTPROTO    0    /* TCP/IP implementation is broken */
  5932. ! # endif
  5933.   # undef SETPROCTITLE
  5934. + /* these include files must be included early on DG/UX */
  5935. + # include <netinet/in.h>
  5936. + # include <arpa/inet.h>
  5937.   # define inet_addr    dgux_inet_addr
  5938.   extern long    dgux_inet_addr();
  5939.   #endif
  5940. ***************
  5941. *** 229,237 ****
  5942.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  5943.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  5944.   # define HASFLOCK    1    /* has flock(2) call */
  5945. ! # define LA_TYPE    LA_INT
  5946. ! # define LA_AVENRUN    "avenrun"
  5947. ! # undef IDENTPROTO        /* TCP/IP implementation is broken */
  5948.   #endif
  5949.   
  5950.   
  5951. --- 288,303 ----
  5952.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  5953.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  5954.   # define HASFLOCK    1    /* has flock(2) call */
  5955. ! # define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
  5956. ! # ifdef vax
  5957. ! #  define LA_TYPE    LA_FLOAT
  5958. ! # else
  5959. ! #  define LA_TYPE    LA_INT
  5960. ! #  define LA_AVENRUN    "avenrun"
  5961. ! # endif
  5962. ! # ifndef IDENTPROTO
  5963. ! #  define IDENTPROTO    0    /* TCP/IP implementation is broken */
  5964. ! # endif
  5965.   #endif
  5966.   
  5967.   
  5968. ***************
  5969. *** 244,251 ****
  5970.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  5971.   # define HASSETREUID    1    /* has setreuid(2) call */
  5972.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  5973. ! /* # define HASFLOCK    1    /* has flock(2) call */
  5974.   # define LA_TYPE    LA_INT
  5975.   #endif
  5976.   
  5977.   
  5978. --- 310,320 ----
  5979.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  5980.   # define HASSETREUID    1    /* has setreuid(2) call */
  5981.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  5982. ! # define HASFLOCK    1    /* has flock(2) call */
  5983.   # define LA_TYPE    LA_INT
  5984. + # ifndef _PATH_SENDMAILPID
  5985. + #  define _PATH_SENDMAILPID    "/var/run/sendmail.pid"
  5986. + # endif
  5987.   #endif
  5988.   
  5989.   
  5990. ***************
  5991. *** 280,285 ****
  5992. --- 349,356 ----
  5993.   
  5994.   /*
  5995.   **  4.4 BSD
  5996. + **
  5997. + **    See also BSD defines.
  5998.   */
  5999.   
  6000.   #ifdef BSD4_4
  6001. ***************
  6002. *** 294,305 ****
  6003.   
  6004.   
  6005.   /*
  6006. ! **  386BSD / FreeBSD 1.0E (works) / NetBSD (not tested)
  6007.   **
  6008.   **  4.3BSD clone, closer to 4.4BSD
  6009.   */
  6010.   
  6011. ! #ifdef __386BSD__
  6012.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  6013.   # define HASSETSID    1    /* has the setsid(2) POSIX syscall */
  6014.   # define HASSTATFS    1    /* has the statfs(2) syscall */
  6015. --- 365,378 ----
  6016.   
  6017.   
  6018.   /*
  6019. ! **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
  6020.   **
  6021.   **  4.3BSD clone, closer to 4.4BSD
  6022. + **
  6023. + **    See also BSD defines.
  6024.   */
  6025.   
  6026. ! #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
  6027.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  6028.   # define HASSETSID    1    /* has the setsid(2) POSIX syscall */
  6029.   # define HASSTATFS    1    /* has the statfs(2) syscall */
  6030. ***************
  6031. *** 312,317 ****
  6032. --- 385,420 ----
  6033.   
  6034.   
  6035.   /*
  6036. + **  Mach386
  6037. + **
  6038. + **    For mt Xinu's Mach386 system.
  6039. + */
  6040. + #if defined(MACH) && defined(i386)
  6041. + # define MACH386    1
  6042. + # define HASUNSETENV    1    /* has unsetenv(3) call */
  6043. + # define HASINITGROUPS    1    /* has initgroups(3) call */
  6044. + # define HASFLOCK    1    /* has flock(2) call */
  6045. + # define HASSTATFS    1    /* has the statfs(2) syscall */
  6046. + # define NEEDGETOPT    1    /* need a replacement for getopt(3) */
  6047. + # define NEEDSTRTOL    1    /* need the strtol() function */
  6048. + # define setpgid    setpgrp
  6049. + # ifndef LA_TYPE
  6050. + #  define LA_TYPE    LA_FLOAT
  6051. + # endif
  6052. + # undef HASSETVBUF        /* don't actually have setvbuf(3) */
  6053. + # undef WEXITSTATUS
  6054. + # undef WIFEXITED
  6055. + # ifndef _PATH_SENDMAILCF
  6056. + #  define _PATH_SENDMAILCF    "/usr/lib/sendmail.cf"
  6057. + # endif
  6058. + # ifndef _PATH_SENDMAILPID
  6059. + #  define _PATH_SENDMAILPID    "/etc/sendmail.pid"
  6060. + # endif
  6061. + #endif
  6062. + /*
  6063.   **  4.3 BSD -- this is for very old systems
  6064.   **
  6065.   **    You'll also have to install a new resolver library.
  6066. ***************
  6067. *** 329,349 ****
  6068.   # ifndef _PATH_SENDMAILCF
  6069.   #  define _PATH_SENDMAILCF    "/usr/lib/sendmail.cf"
  6070.   # endif
  6071. ! # undef IDENTPROTO        /* TCP/IP implementation is broken */
  6072.   #endif
  6073.   
  6074.   
  6075.   /*
  6076.   **  SCO Unix
  6077.   */
  6078.   
  6079.   #ifdef _SCO_unix_
  6080.   # define SYSTEM5    1    /* include all the System V defines */
  6081.   # define SYS5SIGNALS    1    /* SysV signal semantics -- reset on each sig */
  6082.   # define HASSTATFS    1    /* has the statfs(2) syscall */
  6083.   # define FORK        fork
  6084.   # define MAXPATHLEN    PATHSIZE
  6085.   # define LA_TYPE    LA_SHORT
  6086.   #endif
  6087.   
  6088.   
  6089. --- 432,476 ----
  6090.   # ifndef _PATH_SENDMAILCF
  6091.   #  define _PATH_SENDMAILCF    "/usr/lib/sendmail.cf"
  6092.   # endif
  6093. ! # ifndef IDENTPROTO
  6094. ! #  define IDENTPROTO    0    /* TCP/IP implementation is broken */
  6095. ! # endif
  6096. ! # undef WEXITSTATUS
  6097. ! # undef WIFEXITED
  6098. ! typedef short        pid_t;
  6099. ! extern int        errno;
  6100.   #endif
  6101.   
  6102.   
  6103.   /*
  6104.   **  SCO Unix
  6105. + **
  6106. + **    This includes two parts -- the first is for SCO Open Server 3.2v4
  6107. + **    (contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
  6108. + **    The second is, I believe, for an older version.
  6109.   */
  6110.   
  6111. + #ifdef _SCO_unix_4_2
  6112. + # define _SCO_unix_
  6113. + # define HASSETREUID    1    /* has setreuid(2) call */
  6114. + # define _PATH_UNIX    "/unix"
  6115. + # ifndef _PATH_SENDMAILCF
  6116. + #  define _PATH_SENDMAILCF    "/usr/lib/sendmail.cf"
  6117. + # endif
  6118. + # ifndef _PATH_SENDMAILPID
  6119. + #  define _PATH_SENDMAILPID    "/etc/sendmail.pid"
  6120. + # endif
  6121. + #endif
  6122.   #ifdef _SCO_unix_
  6123.   # define SYSTEM5    1    /* include all the System V defines */
  6124.   # define SYS5SIGNALS    1    /* SysV signal semantics -- reset on each sig */
  6125.   # define HASSTATFS    1    /* has the statfs(2) syscall */
  6126. + # define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
  6127.   # define FORK        fork
  6128.   # define MAXPATHLEN    PATHSIZE
  6129.   # define LA_TYPE    LA_SHORT
  6130. + # undef NETUNIX            /* no unix domain socket support */
  6131.   #endif
  6132.   
  6133.   
  6134. ***************
  6135. *** 358,379 ****
  6136.   # define HASSETSID    1    /* has POSIX setsid(2) call */
  6137.   # define NEEDGETOPT    1    /* need replacement for getopt(3) */
  6138.   # define LA_TYPE    LA_FLOAT
  6139. ! # undef IDENTPROTO
  6140.   #endif
  6141.   
  6142.   
  6143.   /*
  6144. ! **  RISC/os 4.51
  6145.   **
  6146. ! **    Untested...
  6147.   */
  6148.   
  6149.   #ifdef RISCOS
  6150.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  6151. ! /* # define HASFLOCK    1    /* has flock(2) call */
  6152.   # define LA_TYPE    LA_INT
  6153.   # define LA_AVENRUN    "avenrun"
  6154.   # define _PATH_UNIX    "/unix"
  6155.   #endif
  6156.   
  6157.   
  6158. --- 485,522 ----
  6159.   # define HASSETSID    1    /* has POSIX setsid(2) call */
  6160.   # define NEEDGETOPT    1    /* need replacement for getopt(3) */
  6161.   # define LA_TYPE    LA_FLOAT
  6162. ! # ifndef IDENTPROTO
  6163. ! #  define IDENTPROTO    0    /* TCP/IP implementation is broken */
  6164. ! # endif
  6165.   #endif
  6166.   
  6167.   
  6168.   /*
  6169. ! **  RISC/os 4.52
  6170.   **
  6171. ! **    Gives a ton of warning messages, but otherwise compiles.
  6172.   */
  6173.   
  6174.   #ifdef RISCOS
  6175.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  6176. ! # define HASFLOCK    1    /* has flock(2) call */
  6177. ! # define WAITUNION    1    /* use "union wait" as wait argument type */
  6178. ! # define NEEDGETOPT    1    /* need a replacement for getopt(3) */
  6179.   # define LA_TYPE    LA_INT
  6180.   # define LA_AVENRUN    "avenrun"
  6181.   # define _PATH_UNIX    "/unix"
  6182. + # undef WIFEXITED
  6183. + # define setpgid    setpgrp
  6184. + extern int        errno;
  6185. + typedef int        pid_t;
  6186. + #define            SIGFUNC_DEFINED
  6187. + typedef int        (*sigfunc_t)();
  6188. + extern char        *getenv();
  6189. + extern void        *malloc();
  6190.   #endif
  6191.   
  6192.   
  6193. ***************
  6194. *** 391,396 ****
  6195. --- 534,540 ----
  6196.   #  define LA_TYPE    LA_FLOAT
  6197.   # endif
  6198.   # include <sys/sysmacros.h>
  6199. + # define GIDSET_T    gid_t
  6200.   #endif
  6201.   
  6202.   
  6203. ***************
  6204. *** 400,418 ****
  6205.   **
  6206.   **    It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
  6207.   **    defined, and the definitions conflict.
  6208.   */
  6209.   
  6210.   #ifdef DELL_SVR4
  6211. ! # define SYSTEM5    1
  6212. ! /* # define setreuid(r, e)    seteuid(e) */
  6213. ! /* # include <sys/time.h> */
  6214. ! # define _PATH_UNIX    "/unix"
  6215. ! # ifndef _PATH_SENDMAILCF
  6216. ! #  define _PATH_SENDMAILCF    "/usr/ucblib/sendmail.cf"
  6217. ! # endif
  6218. ! # ifndef _PATH_SENDMAILPID
  6219. ! #  define _PATH_SENDMAILPID    "/usr/ucblib/sendmail.pid"
  6220. ! # endif
  6221.   #endif
  6222.   
  6223.   
  6224. --- 544,558 ----
  6225.   **
  6226.   **    It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
  6227.   **    defined, and the definitions conflict.
  6228. + **
  6229. + **    Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
  6230. + **    trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
  6231. + **    (SVR4.0/386 version 3.0).
  6232.   */
  6233.   
  6234.   #ifdef DELL_SVR4
  6235. !                 /* no changes necessary */
  6236. !                 /* see general __svr4__ defines below */
  6237.   #endif
  6238.   
  6239.   
  6240. ***************
  6241. *** 428,434 ****
  6242.   # define HASUSTAT    1    /* use System V ustat(2) syscall */
  6243.   # define HASSETVBUF    1    /* we have setvbuf(3) in libc */
  6244.   # define SIGFUNC_DEFINED    /* sigfunc_t already defined */
  6245. ! # undef IDENTPROTO        /* TCP/IP implementation is broken */
  6246.   # define FORK        fork
  6247.   # ifndef _PATH_SENDMAILCF
  6248.   #  define _PATH_SENDMAILCF    "/usr/lib/sendmail.cf"
  6249. --- 568,576 ----
  6250.   # define HASUSTAT    1    /* use System V ustat(2) syscall */
  6251.   # define HASSETVBUF    1    /* we have setvbuf(3) in libc */
  6252.   # define SIGFUNC_DEFINED    /* sigfunc_t already defined */
  6253. ! # ifndef IDENTPROTO
  6254. ! #  define IDENTPROTO    0    /* TCP/IP implementation is broken */
  6255. ! # endif
  6256.   # define FORK        fork
  6257.   # ifndef _PATH_SENDMAILCF
  6258.   #  define _PATH_SENDMAILCF    "/usr/lib/sendmail.cf"
  6259. ***************
  6260. *** 453,458 ****
  6261. --- 595,601 ----
  6262.   # define HASSTATFS    1    /* has the statfs(2) syscall */
  6263.   # define HASSETVBUF    1    /* we have setvbuf(3) in libc */
  6264.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  6265. + # define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
  6266.   # define SYS5SIGNALS    1    /* SysV signal semantics -- reset on each sig */
  6267.   # define SYS5SETPGRP    1    /* use System V setpgrp(2) syscall */
  6268.   # define FORK        fork    /* no vfork(2) primitive available */
  6269. ***************
  6270. *** 464,470 ****
  6271. --- 607,668 ----
  6272.   #endif
  6273.   
  6274.   
  6275. + /*
  6276. + **  Stardent Titan 3000 running TitanOS 4.2.
  6277. + **
  6278. + **    Must be compiled in "cc -43" mode.
  6279. + **
  6280. + **    From Kate Hedstrom <kate@ahab.rutgers.edu>.
  6281. + **
  6282. + **    Note the tweaking below after the BSD defines are set.
  6283. + */
  6284.   
  6285. + #ifdef titan
  6286. + # define setpgid    setpgrp
  6287. + typedef int        pid_t;
  6288. + # undef WIFEXITED
  6289. + # undef WEXITSTATUS
  6290. + #endif
  6291. + /*
  6292. + **  Sequent DYNIX 3.2.0
  6293. + **
  6294. + **    From Jim Davis <jdavis@cs.arizona.edu>.
  6295. + */
  6296. + #ifdef sequent
  6297. + # define BSD        1
  6298. + # define HASUNSETENV    1
  6299. + # define BSD4_3        1    /* to get signal() in conf.c */
  6300. + # define WAITUNION    1
  6301. + # define LA_TYPE    LA_FLOAT
  6302. + # ifdef    _POSIX_VERSION
  6303. + #  undef _POSIX_VERSION        /* set in <unistd.h> */
  6304. + # endif
  6305. + # undef HASSETVBUF        /* don't actually have setvbuf(3) */
  6306. + # define setpgid    setpgrp
  6307. + /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
  6308. + # undef    WIFEXITED
  6309. + # define WIFEXITED(s)    (((union wait*)&(s))->w_stopval != WSTOPPED && \
  6310. +              ((union wait*)&(s))->w_termsig == 0)
  6311. + # define WEXITSTATUS(s)    (((union wait*)&(s))->w_retcode)
  6312. + typedef int        pid_t;
  6313. + # define isgraph(c)    (isprint(c) && (c != ' '))
  6314. + # ifndef _PATH_UNIX
  6315. + #  define _PATH_UNIX    "/dynix"
  6316. + # endif
  6317. + # ifndef _PATH_SENDMAILCF
  6318. + #  define _PATH_SENDMAILCF    "/usr/lib/sendmail.cf"
  6319. + # endif
  6320. + #endif
  6321.   /**********************************************************************
  6322.   **  End of Per-Operating System defines
  6323.   **********************************************************************/
  6324. ***************
  6325. *** 481,491 ****
  6326. --- 679,714 ----
  6327.   # define HASFLOCK    1    /* has flock(2) call */
  6328.   #endif
  6329.   
  6330. + /* general System V Release 4 defines */
  6331. + #ifdef __svr4__
  6332. + # define SYSTEM5    1
  6333. + # define HASSETREUID    1    /* has seteuid(2) call & working saved uids */
  6334. + # ifndef HASGETUSERSHELL
  6335. + #  define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
  6336. + # endif
  6337. + # define setreuid(r, e)    seteuid(e)
  6338. + # ifndef _PATH_UNIX
  6339. + #  define _PATH_UNIX        "/unix"
  6340. + # endif
  6341. + # ifndef _PATH_SENDMAILCF
  6342. + #  define _PATH_SENDMAILCF    "/usr/ucblib/sendmail.cf"
  6343. + # endif
  6344. + # ifndef _PATH_SENDMAILPID
  6345. + #  define _PATH_SENDMAILPID    "/usr/ucblib/sendmail.pid"
  6346. + # endif
  6347. + # ifndef SYSLOG_BUFSIZE
  6348. + #  define SYSLOG_BUFSIZE    128
  6349. + # endif
  6350. + #endif
  6351.   /* general System V defines */
  6352.   # ifdef SYSTEM5
  6353. + # include <sys/sysmacros.h>
  6354.   # define HASUNAME    1    /* use System V uname(2) system call */
  6355.   # define HASUSTAT    1    /* use System V ustat(2) syscall */
  6356.   # define SYS5SETPGRP    1    /* use System V setpgrp(2) syscall */
  6357. + # define HASSETVBUF    1    /* we have setvbuf(3) in libc */
  6358.   # ifndef LA_TYPE
  6359.   #  define LA_TYPE    LA_INT
  6360.   # endif
  6361. ***************
  6362. *** 494,504 ****
  6363.   # define bcmp(s, d, l)        (memcmp((s), (d), (l)))
  6364.   # endif
  6365.   
  6366. - /* general "standard C" defines */
  6367. - #if defined(__STDC__) || defined(SYSTEM5)
  6368. - # define HASSETVBUF    1    /* we have setvbuf(3) in libc */
  6369. - #endif
  6370.   /* general POSIX defines */
  6371.   #ifdef _POSIX_VERSION
  6372.   # define HASSETSID    1    /* has Posix setsid(2) call */
  6373. --- 717,722 ----
  6374. ***************
  6375. *** 515,521 ****
  6376. --- 733,767 ----
  6377.   # define GIDSET_T    int
  6378.   #endif
  6379.   
  6380. + /*
  6381. + **  Tweaking for systems that (for example) claim to be BSD but
  6382. + **  don't have all the standard BSD routines (boo hiss).
  6383. + */
  6384.   
  6385. + #ifdef titan
  6386. + # undef HASINITGROUPS        /* doesn't have initgroups(3) call */
  6387. + #endif
  6388. + /*
  6389. + **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
  6390. + **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
  6391. + **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
  6392. + **  are closed.  Some firewalls return this error if you try to connect
  6393. + **  to the IDENT port (113), so you can't receive email from these hosts
  6394. + **  on these systems.  The firewall really should use a more specific
  6395. + **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
  6396. + **  not explicitly set to zero above, default it on.
  6397. + */
  6398. + #ifndef IDENTPROTO
  6399. + # define IDENTPROTO    1    /* use IDENT proto (RFC 1413) */
  6400. + #endif
  6401. + #ifndef HASGETUSERSHELL
  6402. + # define HASGETUSERSHELL 1    /* libc has getusershell(3) call */
  6403. + #endif
  6404.   /**********************************************************************
  6405.   **  Remaining definitions should never have to be changed.  They are
  6406.   **  primarily to provide back compatibility for older systems -- for
  6407. ***************
  6408. *** 524,531 ****
  6409.   
  6410.   /* System 5 compatibility */
  6411.   #ifndef S_ISREG
  6412. ! #define S_ISREG(foo)    ((foo & S_IFREG) == S_IFREG)
  6413.   #endif
  6414.   #ifndef S_IWGRP
  6415.   #define S_IWGRP        020
  6416.   #endif
  6417. --- 770,780 ----
  6418.   
  6419.   /* System 5 compatibility */
  6420.   #ifndef S_ISREG
  6421. ! # define S_ISREG(foo)    ((foo & S_IFMT) == S_IFREG)
  6422.   #endif
  6423. + #if !defined(S_ISLNK) && defined(S_IFLNK)
  6424. + # define S_ISLNK(foo)    ((foo & S_IFMT) == S_IFLNK)
  6425. + #endif
  6426.   #ifndef S_IWGRP
  6427.   #define S_IWGRP        020
  6428.   #endif
  6429. ***************
  6430. *** 656,661 ****
  6431. --- 905,915 ----
  6432.   typedef void        (*sigfunc_t) __P((int));
  6433.   #endif
  6434.   
  6435. + /* size of syslog buffer */
  6436. + #ifndef SYSLOG_BUFSIZE
  6437. + # define SYSLOG_BUFSIZE    1024
  6438. + #endif
  6439.   /*
  6440.   **  Size of tobuf (deliver.c)
  6441.   **    Tweak this to match your syslog implementation.  It will have to
  6442. ***************
  6443. *** 663,671 ****
  6444.   */
  6445.   
  6446.   #ifndef TOBUFSIZE
  6447. ! # define TOBUFSIZE (1024 - 256)
  6448.   #endif
  6449.   
  6450.   /* fork routine -- set above using #ifdef _osname_ or in Makefile */
  6451.   # ifndef FORK
  6452.   # define FORK        vfork        /* function to call to fork mailer */
  6453. --- 917,936 ----
  6454.   */
  6455.   
  6456.   #ifndef TOBUFSIZE
  6457. ! # if (SYSLOG_BUFSIZE) > 512
  6458. ! #  define TOBUFSIZE    (SYSLOG_BUFSIZE - 256)
  6459. ! # else
  6460. ! #  define TOBUFSIZE    256
  6461. ! # endif
  6462.   #endif
  6463.   
  6464. + /*
  6465. + **  Size of prescan buffer.
  6466. + **    Despite comments in the _sendmail_ book, this probably should
  6467. + **    not be changed; there are some hard-to-define dependencies.
  6468. + */
  6469. + # define PSBUFSIZE    (MAXNAME + MAXATOM)    /* size of prescan buffer */
  6470.   /* fork routine -- set above using #ifdef _osname_ or in Makefile */
  6471.   # ifndef FORK
  6472.   # define FORK        vfork        /* function to call to fork mailer */
  6473. *** src/daemon.c.OLD    Sun Nov  7 10:37:39 1993
  6474. --- src/daemon.c    Sat Jan  8 17:29:32 1994
  6475. ***************
  6476. *** 37,45 ****
  6477.   
  6478.   #ifndef lint
  6479.   #ifdef DAEMON
  6480. ! static char sccsid[] = "@(#)daemon.c    8.21 (Berkeley) 10/31/93 (with daemon mode)";
  6481.   #else
  6482. ! static char sccsid[] = "@(#)daemon.c    8.21 (Berkeley) 10/31/93 (without daemon mode)";
  6483.   #endif
  6484.   #endif /* not lint */
  6485.   
  6486. --- 37,45 ----
  6487.   
  6488.   #ifndef lint
  6489.   #ifdef DAEMON
  6490. ! static char sccsid[] = "@(#)daemon.c    8.30 (Berkeley) 1/8/94 (with daemon mode)";
  6491.   #else
  6492. ! static char sccsid[] = "@(#)daemon.c    8.30 (Berkeley) 1/8/94 (without daemon mode)";
  6493.   #endif
  6494.   #endif /* not lint */
  6495.   
  6496. ***************
  6497. *** 110,119 ****
  6498.   getrequests()
  6499.   {
  6500.       int t;
  6501. -     register struct servent *sp;
  6502.       int on = 1;
  6503.       bool refusingconnections = TRUE;
  6504.       FILE *pidf;
  6505.       extern void reapchild();
  6506.   
  6507.       /*
  6508. --- 110,119 ----
  6509.   getrequests()
  6510.   {
  6511.       int t;
  6512.       int on = 1;
  6513.       bool refusingconnections = TRUE;
  6514.       FILE *pidf;
  6515. +     int socksize;
  6516.       extern void reapchild();
  6517.   
  6518.       /*
  6519. ***************
  6520. *** 126,138 ****
  6521.           DaemonAddr.sin.sin_addr.s_addr = INADDR_ANY;
  6522.       if (DaemonAddr.sin.sin_port == 0)
  6523.       {
  6524.           sp = getservbyname("smtp", "tcp");
  6525.           if (sp == NULL)
  6526.           {
  6527.               syserr("554 service \"smtp\" unknown");
  6528. !             goto severe;
  6529.           }
  6530. !         DaemonAddr.sin.sin_port = sp->s_port;
  6531.       }
  6532.   
  6533.       /*
  6534. --- 126,141 ----
  6535.           DaemonAddr.sin.sin_addr.s_addr = INADDR_ANY;
  6536.       if (DaemonAddr.sin.sin_port == 0)
  6537.       {
  6538. +         register struct servent *sp;
  6539.           sp = getservbyname("smtp", "tcp");
  6540.           if (sp == NULL)
  6541.           {
  6542.               syserr("554 service \"smtp\" unknown");
  6543. !             DaemonAddr.sin.sin_port = htons(25);
  6544.           }
  6545. !         else
  6546. !             DaemonAddr.sin.sin_port = sp->s_port;
  6547.       }
  6548.   
  6549.       /*
  6550. ***************
  6551. *** 177,198 ****
  6552.       {
  6553.   # ifdef NETINET
  6554.         case AF_INET:
  6555. !         t = sizeof DaemonAddr.sin;
  6556.           break;
  6557.   # endif
  6558.   
  6559.   # ifdef NETISO
  6560.         case AF_ISO:
  6561. !         t = sizeof DaemonAddr.siso;
  6562.           break;
  6563.   # endif
  6564.   
  6565.         default:
  6566. !         t = sizeof DaemonAddr;
  6567.           break;
  6568.       }
  6569.   
  6570. !     if (bind(DaemonSocket, &DaemonAddr.sa, t) < 0)
  6571.       {
  6572.           syserr("getrequests: cannot bind");
  6573.           (void) close(DaemonSocket);
  6574. --- 180,201 ----
  6575.       {
  6576.   # ifdef NETINET
  6577.         case AF_INET:
  6578. !         socksize = sizeof DaemonAddr.sin;
  6579.           break;
  6580.   # endif
  6581.   
  6582.   # ifdef NETISO
  6583.         case AF_ISO:
  6584. !         socksize = sizeof DaemonAddr.siso;
  6585.           break;
  6586.   # endif
  6587.   
  6588.         default:
  6589. !         socksize = sizeof DaemonAddr;
  6590.           break;
  6591.       }
  6592.   
  6593. !     if (bind(DaemonSocket, &DaemonAddr.sa, socksize) < 0)
  6594.       {
  6595.           syserr("getrequests: cannot bind");
  6596.           (void) close(DaemonSocket);
  6597. ***************
  6598. *** 260,266 ****
  6599.           do
  6600.           {
  6601.               errno = 0;
  6602. !             lotherend = sizeof RealHostAddr;
  6603.               t = accept(DaemonSocket,
  6604.                   (struct sockaddr *)&RealHostAddr, &lotherend);
  6605.           } while (t < 0 && errno == EINTR);
  6606. --- 263,269 ----
  6607.           do
  6608.           {
  6609.               errno = 0;
  6610. !             lotherend = socksize;
  6611.               t = accept(DaemonSocket,
  6612.                   (struct sockaddr *)&RealHostAddr, &lotherend);
  6613.           } while (t < 0 && errno == EINTR);
  6614. ***************
  6615. *** 299,305 ****
  6616.               */
  6617.   
  6618.               (void) setsignal(SIGCHLD, SIG_DFL);
  6619. -             OpMode = MD_SMTP;
  6620.   
  6621.               /* determine host name */
  6622.               p = hostnamebyanyaddr(&RealHostAddr);
  6623. --- 302,307 ----
  6624. ***************
  6625. *** 613,619 ****
  6626.             case AF_INET:
  6627.               bcopy(hp->h_addr,
  6628.                   &addr.sin.sin_addr,
  6629. !                 hp->h_length);
  6630.               break;
  6631.   #endif
  6632.   
  6633. --- 615,621 ----
  6634.             case AF_INET:
  6635.               bcopy(hp->h_addr,
  6636.                   &addr.sin.sin_addr,
  6637. !                 sizeof addr.sin.sin_addr);
  6638.               break;
  6639.   #endif
  6640.   
  6641. ***************
  6642. *** 639,647 ****
  6643.           if (sp == NULL)
  6644.           {
  6645.               syserr("554 makeconnection: service \"smtp\" unknown");
  6646. !             return (EX_OSERR);
  6647.           }
  6648. !         port = sp->s_port;
  6649.       }
  6650.   
  6651.       switch (addr.sa.sa_family)
  6652. --- 641,650 ----
  6653.           if (sp == NULL)
  6654.           {
  6655.               syserr("554 makeconnection: service \"smtp\" unknown");
  6656. !             port = htons(25);
  6657.           }
  6658. !         else
  6659. !             port = sp->s_port;
  6660.       }
  6661.   
  6662.       switch (addr.sa.sa_family)
  6663. ***************
  6664. *** 742,748 ****
  6665.                 case AF_INET:
  6666.                   bcopy(hp->h_addr_list[i++],
  6667.                         &addr.sin.sin_addr,
  6668. !                       hp->h_length);
  6669.                   break;
  6670.   #endif
  6671.   
  6672. --- 745,751 ----
  6673.                 case AF_INET:
  6674.                   bcopy(hp->h_addr_list[i++],
  6675.                         &addr.sin.sin_addr,
  6676. !                       sizeof addr.sin.sin_addr);
  6677.                   break;
  6678.   #endif
  6679.   
  6680. ***************
  6681. *** 846,852 ****
  6682.   **        Sets RealHostName to the name of the host at the other end.
  6683.   */
  6684.   
  6685. ! #ifdef IDENTPROTO
  6686.   
  6687.   static jmp_buf    CtxAuthTimeout;
  6688.   
  6689. --- 849,855 ----
  6690.   **        Sets RealHostName to the name of the host at the other end.
  6691.   */
  6692.   
  6693. ! #if IDENTPROTO
  6694.   
  6695.   static jmp_buf    CtxAuthTimeout;
  6696.   
  6697. ***************
  6698. *** 865,871 ****
  6699.       SOCKADDR fa;
  6700.       int falen;
  6701.       register char *p;
  6702. ! #ifdef IDENTPROTO
  6703.       SOCKADDR la;
  6704.       int lalen;
  6705.       register struct servent *sp;
  6706. --- 868,874 ----
  6707.       SOCKADDR fa;
  6708.       int falen;
  6709.       register char *p;
  6710. ! #if IDENTPROTO
  6711.       SOCKADDR la;
  6712.       int lalen;
  6713.       register struct servent *sp;
  6714. ***************
  6715. *** 878,884 ****
  6716.       extern char RealUserName[];            /* main.c */
  6717.   
  6718.       falen = sizeof fa;
  6719. !     if (getpeername(fd, &fa.sa, &falen) < 0 || falen <= 0)
  6720.       {
  6721.           RealHostName = "localhost";
  6722.           (void) sprintf(hbuf, "%s@localhost", RealUserName);
  6723. --- 881,888 ----
  6724.       extern char RealUserName[];            /* main.c */
  6725.   
  6726.       falen = sizeof fa;
  6727. !     if (getpeername(fd, &fa.sa, &falen) < 0 || falen <= 0 ||
  6728. !         fa.sa.sa_family == 0)
  6729.       {
  6730.           RealHostName = "localhost";
  6731.           (void) sprintf(hbuf, "%s@localhost", RealUserName);
  6732. ***************
  6733. *** 891,897 ****
  6734.       RealHostName = newstr(p);
  6735.       RealHostAddr = fa;
  6736.   
  6737. ! #ifdef IDENTPROTO
  6738.       lalen = sizeof la;
  6739.       if (fa.sa.sa_family != AF_INET ||
  6740.           getsockname(fd, &la.sa, &lalen) < 0 || lalen <= 0 ||
  6741. --- 895,901 ----
  6742.       RealHostName = newstr(p);
  6743.       RealHostAddr = fa;
  6744.   
  6745. ! #if IDENTPROTO
  6746.       lalen = sizeof la;
  6747.       if (fa.sa.sa_family != AF_INET ||
  6748.           getsockname(fd, &la.sa, &lalen) < 0 || lalen <= 0 ||
  6749. ***************
  6750. *** 1049,1055 ****
  6751.       char *cp;
  6752.       int i;
  6753.       register STAB *s;
  6754. -     char *timeoutmsg = "Recipient domain nameserver timed out";
  6755.       char hbuf[MAXNAME];
  6756.       extern struct hostent *gethostbyaddr();
  6757.       extern int h_errno;
  6758. --- 1053,1058 ----
  6759. ***************
  6760. *** 1069,1075 ****
  6761.           h_errno = s->s_namecanon.nc_herrno;
  6762.           *statp = s->s_namecanon.nc_stat;
  6763.           if (CurEnv->e_message == NULL && *statp == EX_TEMPFAIL)
  6764. !             CurEnv->e_message = newstr(timeoutmsg);
  6765.           return s->s_namecanon.nc_cname;
  6766.       }
  6767.   
  6768. --- 1072,1082 ----
  6769.           h_errno = s->s_namecanon.nc_herrno;
  6770.           *statp = s->s_namecanon.nc_stat;
  6771.           if (CurEnv->e_message == NULL && *statp == EX_TEMPFAIL)
  6772. !         {
  6773. !             sprintf(hbuf, "%s: Name server timeout",
  6774. !                 shortenstring(name, 33));
  6775. !             CurEnv->e_message = newstr(hbuf);
  6776. !         }
  6777.           return s->s_namecanon.nc_cname;
  6778.       }
  6779.   
  6780. ***************
  6781. *** 1109,1117 ****
  6782.                 case TRY_AGAIN:
  6783.                   if (UseNameServer)
  6784.                   {
  6785. !                     message(timeoutmsg);
  6786.                       if (CurEnv->e_message == NULL)
  6787. !                         CurEnv->e_message = newstr(timeoutmsg);
  6788.                   }
  6789.                   *statp = EX_TEMPFAIL;
  6790.                   break;
  6791. --- 1116,1126 ----
  6792.                 case TRY_AGAIN:
  6793.                   if (UseNameServer)
  6794.                   {
  6795. !                     sprintf(hbuf, "%s: Name server timeout",
  6796. !                         shortenstring(name, 33));
  6797. !                     message("%s", hbuf);
  6798.                       if (CurEnv->e_message == NULL)
  6799. !                         CurEnv->e_message = newstr(hbuf);
  6800.                   }
  6801.                   *statp = EX_TEMPFAIL;
  6802.                   break;
  6803. ***************
  6804. *** 1200,1205 ****
  6805. --- 1209,1215 ----
  6806.       switch (sap->sa.sa_family)
  6807.       {
  6808.   #ifdef MAYBENEXTRELEASE        /*** UNTESTED *** UNTESTED *** UNTESTED ***/
  6809. + #ifdef NETUNIX
  6810.         case AF_UNIX:
  6811.             if (sap->sunix.sun_path[0] != '\0')
  6812.                 sprintf(buf, "[UNIX: %.64s]", sap->sunix.sun_path);
  6813. ***************
  6814. *** 1206,1211 ****
  6815. --- 1216,1222 ----
  6816.             else
  6817.                 sprintf(buf, "[UNIX: localhost]");
  6818.           return buf;
  6819. + #endif
  6820.   #endif
  6821.   
  6822.   #ifdef NETINET
  6823. *** src/deliver.c.OLD    Thu Nov  4 06:54:43 1993
  6824. --- src/deliver.c    Wed Jan 12 12:38:48 1994
  6825. ***************
  6826. *** 33,39 ****
  6827.    */
  6828.   
  6829.   #ifndef lint
  6830. ! static char sccsid[] = "@(#)deliver.c    8.37 (Berkeley) 10/29/93";
  6831.   #endif /* not lint */
  6832.   
  6833.   #include "sendmail.h"
  6834. --- 33,39 ----
  6835.    */
  6836.   
  6837.   #ifndef lint
  6838. ! static char sccsid[] = "@(#)deliver.c    8.62 (Berkeley) 1/12/94";
  6839.   #endif /* not lint */
  6840.   
  6841.   #include "sendmail.h"
  6842. ***************
  6843. *** 46,51 ****
  6844. --- 46,53 ----
  6845.   extern int    h_errno;
  6846.   #endif
  6847.   
  6848. + extern char    SmtpError[];
  6849.   /*
  6850.   **  SENDALL -- actually send all the messages.
  6851.   **
  6852. ***************
  6853. *** 82,88 ****
  6854.       **  addresses to be sent.
  6855.       */
  6856.   
  6857. !     if (bitset(EF_FATALERRS, e->e_flags) && OpMode == MD_SMTP)
  6858.       {
  6859.           e->e_flags |= EF_CLRQUEUE;
  6860.           return;
  6861. --- 84,91 ----
  6862.       **  addresses to be sent.
  6863.       */
  6864.   
  6865. !     if (bitset(EF_FATALERRS, e->e_flags) &&
  6866. !         (OpMode == MD_SMTP || OpMode == MD_DAEMON))
  6867.       {
  6868.           e->e_flags |= EF_CLRQUEUE;
  6869.           return;
  6870. ***************
  6871. *** 89,94 ****
  6872. --- 92,98 ----
  6873.       }
  6874.   
  6875.       /* determine actual delivery mode */
  6876. +     CurrentLA = getla();
  6877.       if (mode == SM_DEFAULT)
  6878.       {
  6879.           mode = e->e_sendmode;
  6880. ***************
  6881. *** 333,339 ****
  6882.       **  addresses to be sent.
  6883.       */
  6884.   
  6885. !     if (bitset(EF_FATALERRS, e->e_flags) && OpMode == MD_SMTP)
  6886.       {
  6887.           e->e_flags |= EF_CLRQUEUE;
  6888.           return;
  6889. --- 337,344 ----
  6890.       **  addresses to be sent.
  6891.       */
  6892.   
  6893. !     if (bitset(EF_FATALERRS, e->e_flags) &&
  6894. !         (OpMode == MD_SMTP || OpMode == MD_DAEMON))
  6895.       {
  6896.           e->e_flags |= EF_CLRQUEUE;
  6897.           return;
  6898. ***************
  6899. *** 447,456 ****
  6900.               e->e_to = q->q_paddr;
  6901.               if (!bitset(QDONTSEND|QBADADDR, q->q_flags))
  6902.               {
  6903. !                 message("deliverable: mailer %s, host %s, user %s",
  6904. !                     q->q_mailer->m_name,
  6905. !                     q->q_host,
  6906. !                     q->q_user);
  6907.               }
  6908.           }
  6909.           else if (!bitset(QDONTSEND|QBADADDR, q->q_flags))
  6910. --- 452,466 ----
  6911.               e->e_to = q->q_paddr;
  6912.               if (!bitset(QDONTSEND|QBADADDR, q->q_flags))
  6913.               {
  6914. !                 if (q->q_host != NULL && q->q_host[0] != '\0')
  6915. !                     message("deliverable: mailer %s, host %s, user %s",
  6916. !                         q->q_mailer->m_name,
  6917. !                         q->q_host,
  6918. !                         q->q_user);
  6919. !                 else
  6920. !                     message("deliverable: mailer %s, user %s",
  6921. !                         q->q_mailer->m_name,
  6922. !                         q->q_user);
  6923.               }
  6924.           }
  6925.           else if (!bitset(QDONTSEND|QBADADDR, q->q_flags))
  6926. ***************
  6927. *** 589,595 ****
  6928.       char buf[MAXNAME];
  6929.       char rpathbuf[MAXNAME];        /* translated return path */
  6930.       extern int checkcompat();
  6931. -     extern char SmtpError[];
  6932.   
  6933.       errno = 0;
  6934.       if (bitset(QDONTSEND|QBADADDR|QQUEUEUP, to->q_flags))
  6935. --- 599,604 ----
  6936. ***************
  6937. *** 597,603 ****
  6938.   
  6939.   #ifdef NAMED_BIND
  6940.       /* unless interactive, try twice, over a minute */
  6941. !     if (OpMode == MD_DAEMON || OpMode == MD_SMTP) {
  6942.           _res.retrans = 30;
  6943.           _res.retry = 2;
  6944.       }
  6945. --- 606,613 ----
  6946.   
  6947.   #ifdef NAMED_BIND
  6948.       /* unless interactive, try twice, over a minute */
  6949. !     if (OpMode == MD_DAEMON || OpMode == MD_SMTP)
  6950. !     {
  6951.           _res.retrans = 30;
  6952.           _res.retry = 2;
  6953.       }
  6954. ***************
  6955. *** 759,765 ****
  6956.           }
  6957.   
  6958.           /* compute effective uid/gid when sending */
  6959. !         if (to->q_mailer == ProgMailer)
  6960.               ctladdr = getctladdr(to);
  6961.   
  6962.           user = to->q_user;
  6963. --- 769,777 ----
  6964.           }
  6965.   
  6966.           /* compute effective uid/gid when sending */
  6967. !         /* XXX perhaps this should be to->q_mailer != LocalMailer ?? */
  6968. !         /* XXX perhaps it should be a mailer flag? */
  6969. !         if (to->q_mailer == ProgMailer || to->q_mailer == FileMailer)
  6970.               ctladdr = getctladdr(to);
  6971.   
  6972.           user = to->q_user;
  6973. ***************
  6974. *** 831,840 ****
  6975.   
  6976.           if (m == FileMailer)
  6977.           {
  6978. !             ADDRESS *caddr = getctladdr(to);
  6979. !             rcode = mailfile(user, caddr, e);
  6980. !             giveresponse(rcode, m, NULL, caddr, e);
  6981.               if (rcode == EX_OK)
  6982.                   to->q_flags |= QSENT;
  6983.               continue;
  6984. --- 843,850 ----
  6985.   
  6986.           if (m == FileMailer)
  6987.           {
  6988. !             rcode = mailfile(user, ctladdr, e);
  6989. !             giveresponse(rcode, m, NULL, ctladdr, e);
  6990.               if (rcode == EX_OK)
  6991.                   to->q_flags |= QSENT;
  6992.               continue;
  6993. ***************
  6994. *** 905,912 ****
  6995.       **    If we are running SMTP, we just need to clean up.
  6996.       */
  6997.   
  6998. !     if (ctladdr == NULL && m != ProgMailer)
  6999.           ctladdr = &e->e_from;
  7000.   #ifdef NAMED_BIND
  7001.       if (ConfigLevel < 2)
  7002.           _res.options &= ~(RES_DEFNAMES | RES_DNSRCH);    /* XXX */
  7003. --- 915,924 ----
  7004.       **    If we are running SMTP, we just need to clean up.
  7005.       */
  7006.   
  7007. !     /*XXX this seems a bit wierd */
  7008. !     if (ctladdr == NULL && bitset(QGOODUID, e->e_from.q_flags))
  7009.           ctladdr = &e->e_from;
  7010.   #ifdef NAMED_BIND
  7011.       if (ConfigLevel < 2)
  7012.           _res.options &= ~(RES_DEFNAMES | RES_DNSRCH);    /* XXX */
  7013. ***************
  7014. *** 961,972 ****
  7015.           register int i;
  7016.           register u_short port;
  7017.   
  7018.           CurHostName = pv[1];
  7019.           curhost = hostsignature(m, pv[1], e);
  7020.   
  7021.           if (curhost == NULL || curhost[0] == '\0')
  7022.           {
  7023. !             syserr("null signature");
  7024.               rcode = EX_OSERR;
  7025.               goto give_up;
  7026.           }
  7027. --- 973,991 ----
  7028.           register int i;
  7029.           register u_short port;
  7030.   
  7031. +         if (pv[0] == NULL || pv[1] == NULL || pv[1][0] == '\0')
  7032. +         {
  7033. +             syserr("null host name for %s mailer", m->m_mailer);
  7034. +             rcode = EX_CONFIG;
  7035. +             goto give_up;
  7036. +         }
  7037.           CurHostName = pv[1];
  7038.           curhost = hostsignature(m, pv[1], e);
  7039.   
  7040.           if (curhost == NULL || curhost[0] == '\0')
  7041.           {
  7042. !             syserr("null host signature for %s", pv[1]);
  7043.               rcode = EX_OSERR;
  7044.               goto give_up;
  7045.           }
  7046. ***************
  7047. *** 1153,1158 ****
  7048. --- 1172,1178 ----
  7049.                   if (ctladdr == NULL || ctladdr->q_uid == 0)
  7050.                   {
  7051.                       (void) initgroups(DefUser, DefGid);
  7052. +                     (void) setgid(DefGid);
  7053.                       (void) setuid(DefUid);
  7054.                   }
  7055.                   else
  7056. ***************
  7057. *** 1160,1165 ****
  7058. --- 1180,1186 ----
  7059.                       (void) initgroups(ctladdr->q_ruser?
  7060.                           ctladdr->q_ruser: ctladdr->q_user,
  7061.                           ctladdr->q_gid);
  7062. +                     (void) setgid(ctladdr->q_gid);
  7063.                       (void) setuid(ctladdr->q_uid);
  7064.                   }
  7065.               }
  7066. ***************
  7067. *** 1202,1208 ****
  7068.                   }
  7069.                   (void) close(rpvect[1]);
  7070.               }
  7071. !             else if (OpMode == MD_SMTP || HoldErrs)
  7072.               {
  7073.                   /* put mailer output in transcript */
  7074.                   if (dup2(fileno(e->e_xfp), STDOUT_FILENO) < 0)
  7075. --- 1223,1229 ----
  7076.                   }
  7077.                   (void) close(rpvect[1]);
  7078.               }
  7079. !             else if (OpMode == MD_SMTP || OpMode == MD_DAEMON || HoldErrs)
  7080.               {
  7081.                   /* put mailer output in transcript */
  7082.                   if (dup2(fileno(e->e_xfp), STDOUT_FILENO) < 0)
  7083. ***************
  7084. *** 1333,1339 ****
  7085.                   rcode, mci->mci_state, firstsig);
  7086.               rcode = EX_SOFTWARE;
  7087.           }
  7088. !         else if (rcode == EX_TEMPFAIL && *curhost != '\0')
  7089.           {
  7090.               /* try next MX site */
  7091.               goto tryhost;
  7092. --- 1354,1360 ----
  7093.                   rcode, mci->mci_state, firstsig);
  7094.               rcode = EX_SOFTWARE;
  7095.           }
  7096. !         else if (rcode == EX_TEMPFAIL && curhost != NULL && *curhost != '\0')
  7097.           {
  7098.               /* try next MX site */
  7099.               goto tryhost;
  7100. ***************
  7101. *** 1403,1409 ****
  7102.               if (!bitset(MCIF_CACHED, mci->mci_flags))
  7103.                   smtpquit(m, mci, e);
  7104.           }
  7105. !         if (rcode != EX_OK && *curhost != '\0')
  7106.           {
  7107.               /* try next MX site */
  7108.               goto tryhost;
  7109. --- 1424,1430 ----
  7110.               if (!bitset(MCIF_CACHED, mci->mci_flags))
  7111.                   smtpquit(m, mci, e);
  7112.           }
  7113. !         if (rcode != EX_OK && curhost != NULL && *curhost != '\0')
  7114.           {
  7115.               /* try next MX site */
  7116.               goto tryhost;
  7117. ***************
  7118. *** 1500,1511 ****
  7119.   {
  7120.       char buf[MAXLINE];
  7121.   
  7122. !     if (rcode == EX_OK)
  7123. !         return;
  7124. !     else if (rcode == EX_TEMPFAIL)
  7125.           q->q_flags |= QQUEUEUP;
  7126. !     else if (rcode != EX_IOERR && rcode != EX_OSERR)
  7127.           q->q_flags |= QBADADDR;
  7128.   }
  7129.    /*
  7130.   **  ENDMAILER -- Wait for mailer to terminate.
  7131. --- 1521,1541 ----
  7132.   {
  7133.       char buf[MAXLINE];
  7134.   
  7135. !     switch (rcode)
  7136. !     {
  7137. !       case EX_OK:
  7138. !         break;
  7139. !       case EX_TEMPFAIL:
  7140. !       case EX_IOERR:
  7141. !       case EX_OSERR:
  7142.           q->q_flags |= QQUEUEUP;
  7143. !         break;
  7144. !       default:
  7145.           q->q_flags |= QBADADDR;
  7146. +         break;
  7147. +     }
  7148.   }
  7149.    /*
  7150.   **  ENDMAILER -- Wait for mailer to terminate.
  7151. ***************
  7152. *** 1537,1545 ****
  7153.   
  7154.       /* close any connections */
  7155.       if (mci->mci_in != NULL)
  7156. !         (void) xfclose(mci->mci_in, pv[0], "mci_in");
  7157.       if (mci->mci_out != NULL)
  7158. !         (void) xfclose(mci->mci_out, pv[0], "mci_out");
  7159.       mci->mci_in = mci->mci_out = NULL;
  7160.       mci->mci_state = MCIS_CLOSED;
  7161.   
  7162. --- 1567,1575 ----
  7163.   
  7164.       /* close any connections */
  7165.       if (mci->mci_in != NULL)
  7166. !         (void) xfclose(mci->mci_in, mci->mci_mailer->m_name, "mci_in");
  7167.       if (mci->mci_out != NULL)
  7168. !         (void) xfclose(mci->mci_out, mci->mci_mailer->m_name, "mci_out");
  7169.       mci->mci_in = mci->mci_out = NULL;
  7170.       mci->mci_state = MCIS_CLOSED;
  7171.   
  7172. ***************
  7173. *** 1562,1571 ****
  7174.       }
  7175.   
  7176.       /* it died a horrid death */
  7177. !     syserr("mailer %s died with signal %o", pv[0], st);
  7178.   
  7179.       /* log the arguments */
  7180. !     if (e->e_xfp != NULL)
  7181.       {
  7182.           register char **av;
  7183.   
  7184. --- 1592,1602 ----
  7185.       }
  7186.   
  7187.       /* it died a horrid death */
  7188. !     syserr("451 mailer %s died with signal %o",
  7189. !         mci->mci_mailer->m_name, st);
  7190.   
  7191.       /* log the arguments */
  7192. !     if (pv != NULL && e->e_xfp != NULL)
  7193.       {
  7194.           register char **av;
  7195.   
  7196. ***************
  7197. *** 1647,1654 ****
  7198.               else
  7199.               {
  7200.   #ifdef SMTP
  7201. -                 extern char SmtpError[];
  7202.                   statmsg = SmtpError;
  7203.   #else /* SMTP */
  7204.                   statmsg = NULL;
  7205. --- 1678,1683 ----
  7206. ***************
  7207. *** 1710,1716 ****
  7208.   
  7209.       if (stat != EX_TEMPFAIL)
  7210.           setstat(stat);
  7211. !     if (stat != EX_OK)
  7212.       {
  7213.           if (e->e_message != NULL)
  7214.               free(e->e_message);
  7215. --- 1739,1745 ----
  7216.   
  7217.       if (stat != EX_TEMPFAIL)
  7218.           setstat(stat);
  7219. !     if (stat != EX_OK && (stat != EX_TEMPFAIL || e->e_message == NULL))
  7220.       {
  7221.           if (e->e_message != NULL)
  7222.               free(e->e_message);
  7223. ***************
  7224. *** 1724,1729 ****
  7225. --- 1753,1762 ----
  7226.    /*
  7227.   **  LOGDELIVERY -- log the delivery in the system log
  7228.   **
  7229. + **    Care is taken to avoid logging lines that are too long, because
  7230. + **    some versions of syslog have an unfortunate proclivity for core
  7231. + **    dumping.  This is a hack, to be sure, that is at best empirical.
  7232. + **
  7233.   **    Parameters:
  7234.   **        m -- the mailer info.  Can be NULL for initial queue.
  7235.   **        mci -- the mailer connection info -- can be NULL if the
  7236. ***************
  7237. *** 1748,1760 ****
  7238.   {
  7239.   # ifdef LOG
  7240.       register char *bp;
  7241.       char buf[512];
  7242.   
  7243.       bp = buf;
  7244.       if (ctladdr != NULL)
  7245.       {
  7246.           strcpy(bp, ", ctladdr=");
  7247. !         strcat(bp, ctladdr->q_paddr);
  7248.           bp += strlen(bp);
  7249.           if (bitset(QGOODUID, ctladdr->q_flags))
  7250.           {
  7251. --- 1781,1796 ----
  7252.   {
  7253.   # ifdef LOG
  7254.       register char *bp;
  7255. +     register char *p;
  7256. +     int l;
  7257.       char buf[512];
  7258.   
  7259. + #  if (SYSLOG_BUFSIZE) >= 256
  7260.       bp = buf;
  7261.       if (ctladdr != NULL)
  7262.       {
  7263.           strcpy(bp, ", ctladdr=");
  7264. !         strcat(bp, shortenstring(ctladdr->q_paddr, 83));
  7265.           bp += strlen(bp);
  7266.           if (bitset(QGOODUID, ctladdr->q_flags))
  7267.           {
  7268. ***************
  7269. *** 1799,1807 ****
  7270.               (void) strcat(bp, p);
  7271.           }
  7272.       }
  7273.           
  7274. !     syslog(LOG_INFO, "%s: to=%s%s, stat=%s",
  7275. !            e->e_id, e->e_to, buf, stat);
  7276.   # endif /* LOG */
  7277.   }
  7278.    /*
  7279. --- 1835,1945 ----
  7280.               (void) strcat(bp, p);
  7281.           }
  7282.       }
  7283. +     bp += strlen(bp);
  7284. + #define STATLEN        (((SYSLOG_BUFSIZE) - 100) / 4)
  7285. + #if (STATLEN) < 63
  7286. + # undef STATLEN
  7287. + # define STATLEN    63
  7288. + #endif
  7289. + #if (STATLEN) > 203
  7290. + # undef STATLEN
  7291. + # define STATLEN    203
  7292. + #endif
  7293. +     if ((bp - buf) > (sizeof buf - ((STATLEN) + 20)))
  7294. +     {
  7295. +         /* desperation move -- truncate data */
  7296. +         bp = buf + sizeof buf - ((STATLEN) + 17);
  7297. +         strcpy(bp, "...");
  7298. +         bp += 3;
  7299. +     }
  7300. +     (void) strcpy(bp, ", stat=");
  7301. +     bp += strlen(bp);
  7302. +     (void) strcpy(bp, shortenstring(stat, (STATLEN)));
  7303.           
  7304. !     l = SYSLOG_BUFSIZE - 100 - strlen(buf);
  7305. !     p = e->e_to;
  7306. !     while (strlen(p) >= l)
  7307. !     {
  7308. !         register char *q = strchr(p + l, ',');
  7309. !         if (q == NULL)
  7310. !             break;
  7311. !         syslog(LOG_INFO, "%s: to=%.*s [more]%s",
  7312. !             e->e_id, ++q - p, p, buf);
  7313. !         p = q;
  7314. !     }
  7315. !     syslog(LOG_INFO, "%s: to=%s%s", e->e_id, p, buf);
  7316. ! #  else        /* we have a very short log buffer size */
  7317. !     l = SYSLOG_BUFSIZE - 80;
  7318. !     p = e->e_to;
  7319. !     while (strlen(p) >= l)
  7320. !     {
  7321. !         register char *q = strchr(p + l, ',');
  7322. !         if (q == NULL)
  7323. !             break;
  7324. !         syslog(LOG_INFO, "%s: to=%.*s [more]",
  7325. !             e->e_id, ++q - p, p);
  7326. !         p = q;
  7327. !     }
  7328. !     syslog(LOG_INFO, "%s: to=%s", e->e_id, p);
  7329. !     if (ctladdr != NULL)
  7330. !     {
  7331. !         bp = buf;
  7332. !         strcpy(buf, "ctladdr=");
  7333. !         bp += strlen(buf);
  7334. !         strcpy(bp, shortenstring(ctladdr->q_paddr, 83));
  7335. !         bp += strlen(buf);
  7336. !         if (bitset(QGOODUID, ctladdr->q_flags))
  7337. !         {
  7338. !             (void) sprintf(bp, " (%d/%d)",
  7339. !                     ctladdr->q_uid, ctladdr->q_gid);
  7340. !             bp += strlen(bp);
  7341. !         }
  7342. !         syslog(LOG_INFO, "%s: %s", e->e_id, buf);
  7343. !     }
  7344. !     bp = buf;
  7345. !     sprintf(bp, "delay=%s", pintvl(curtime() - e->e_ctime, TRUE));
  7346. !     bp += strlen(bp);
  7347. !     if (m != NULL)
  7348. !     {
  7349. !         sprintf(bp, ", mailer=%s", m->m_name);
  7350. !         bp += strlen(bp);
  7351. !     }
  7352. !     if (mci != NULL && mci->mci_host != NULL)
  7353. !     {
  7354. ! # ifdef DAEMON
  7355. !         extern SOCKADDR CurHostAddr;
  7356. ! # endif
  7357. !         sprintf(bp, ", relay=%s", mci->mci_host);
  7358. ! # ifdef DAEMON
  7359. !         (void) strcat(bp, " (");
  7360. !         (void) strcat(bp, anynet_ntoa(&CurHostAddr));
  7361. !         (void) strcat(bp, ")");
  7362. ! # endif
  7363. !     }
  7364. !     else
  7365. !     {
  7366. !         char *p = macvalue('h', e);
  7367. !         if (p != NULL && p[0] != '\0')
  7368. !             sprintf(bp, ", relay=%s", p);
  7369. !     }
  7370. !     syslog(LOG_INFO, "%s: %s", e->e_id, buf);
  7371. !     syslog(LOG_INFO, "%s: stat=%s", e->e_id, shortenstring(stat, 63));
  7372. ! #  endif /* short log buffer */
  7373.   # endif /* LOG */
  7374.   }
  7375.    /*
  7376. ***************
  7377. *** 2013,2021 ****
  7378.   
  7379.           if (bitset(0111, stb.st_mode))
  7380.               exit(EX_CANTCREAT);
  7381. !         if (ctladdr == NULL)
  7382. !             ctladdr = &e->e_from;
  7383. !         else
  7384.           {
  7385.               /* ignore setuid and setgid bits */
  7386.               mode &= ~(S_ISGID|S_ISUID);
  7387. --- 2151,2157 ----
  7388.   
  7389.           if (bitset(0111, stb.st_mode))
  7390.               exit(EX_CANTCREAT);
  7391. !         if (ctladdr != NULL)
  7392.           {
  7393.               /* ignore setuid and setgid bits */
  7394.               mode &= ~(S_ISGID|S_ISUID);
  7395. ***************
  7396. *** 2034,2040 ****
  7397.   
  7398.           if (!bitset(S_ISGID, mode) || setgid(stb.st_gid) < 0)
  7399.           {
  7400. !             if (ctladdr->q_uid == 0)
  7401.               {
  7402.                   (void) initgroups(DefUser, DefGid);
  7403.               }
  7404. --- 2170,2176 ----
  7405.   
  7406.           if (!bitset(S_ISGID, mode) || setgid(stb.st_gid) < 0)
  7407.           {
  7408. !             if (ctladdr == NULL || ctladdr->q_uid == 0)
  7409.               {
  7410.                   (void) initgroups(DefUser, DefGid);
  7411.               }
  7412. ***************
  7413. *** 2047,2053 ****
  7414.           }
  7415.           if (!bitset(S_ISUID, mode) || setuid(stb.st_uid) < 0)
  7416.           {
  7417. !             if (ctladdr->q_uid == 0)
  7418.                   (void) setuid(DefUid);
  7419.               else
  7420.                   (void) setuid(ctladdr->q_uid);
  7421. --- 2183,2189 ----
  7422.           }
  7423.           if (!bitset(S_ISUID, mode) || setuid(stb.st_uid) < 0)
  7424.           {
  7425. !             if (ctladdr == NULL || ctladdr->q_uid == 0)
  7426.                   (void) setuid(DefUid);
  7427.               else
  7428.                   (void) setuid(ctladdr->q_uid);
  7429. ***************
  7430. *** 2174,2180 ****
  7431.           if (nmx <= 0)
  7432.           {
  7433.               register MCI *mci;
  7434. -             extern int errno;
  7435.   
  7436.               /* update the connection info for this host */
  7437.               mci = mci_get(hp, m);
  7438. --- 2310,2315 ----
  7439. *** src/domain.c.OLD    Fri Nov 26 17:49:18 1993
  7440. --- src/domain.c    Tue Dec 21 14:52:18 1993
  7441. ***************
  7442. *** 36,44 ****
  7443.   
  7444.   #ifndef lint
  7445.   #ifdef NAMED_BIND
  7446. ! static char sccsid[] = "@(#)domain.c    8.8 (Berkeley) 9/29/93 (with name server)";
  7447.   #else
  7448. ! static char sccsid[] = "@(#)domain.c    8.8 (Berkeley) 9/29/93 (without name server)";
  7449.   #endif
  7450.   #endif /* not lint */
  7451.   
  7452. --- 36,44 ----
  7453.   
  7454.   #ifndef lint
  7455.   #ifdef NAMED_BIND
  7456. ! static char sccsid[] = "@(#)domain.c    8.10 (Berkeley) 12/21/93 (with name server)";
  7457.   #else
  7458. ! static char sccsid[] = "@(#)domain.c    8.10 (Berkeley) 12/21/93 (without name server)";
  7459.   #endif
  7460.   #endif /* not lint */
  7461.   
  7462. ***************
  7463. *** 158,163 ****
  7464. --- 158,169 ----
  7465.             case HOST_NOT_FOUND:
  7466.               /* the host just doesn't exist */
  7467.               *rcode = EX_NOHOST;
  7468. +             if (!UseNameServer)
  7469. +             {
  7470. +                 /* might exist in /etc/hosts */
  7471. +                 goto punt;
  7472. +             }
  7473.               break;
  7474.   
  7475.             case TRY_AGAIN:
  7476. ***************
  7477. *** 419,426 ****
  7478. --- 425,434 ----
  7479.       bool gotmx;
  7480.       int qtype;
  7481.       int loopcnt;
  7482. +     char *xp;
  7483.       char nbuf[MAX(PACKETSZ, MAXDNAME*2+2)];
  7484.       char *searchlist[MAXDNSRCH+2];
  7485. +     extern char *gethostalias();
  7486.   
  7487.       if (tTd(8, 2))
  7488.           printf("getcanonname(%s)\n", host);
  7489. ***************
  7490. *** 444,449 ****
  7491. --- 452,471 ----
  7492.           if (*cp == '.')
  7493.               n++;
  7494.   
  7495. +     if (n == 0 && (xp = gethostalias(host)) != NULL)
  7496. +     {
  7497. +         if (loopcnt++ > MAXCNAMEDEPTH)
  7498. +         {
  7499. +             syserr("loop in ${HOSTALIASES} file");
  7500. +         }
  7501. +         else
  7502. +         {
  7503. +             strncpy(host, xp, hbsize);
  7504. +             host[hbsize - 1] = '\0';
  7505. +             goto cnameloop;
  7506. +         }
  7507. +     }
  7508.       dp = searchlist;
  7509.       if (n > 0)
  7510.           *dp++ = "";
  7511. ***************
  7512. *** 636,641 ****
  7513. --- 658,711 ----
  7514.       host[hbsize - 1] = '\0';
  7515.       return TRUE;
  7516.   }
  7517. + char *
  7518. + gethostalias(host)
  7519. +     char *host;
  7520. + {
  7521. +     char *fname;
  7522. +     FILE *fp;
  7523. +     register char *p;
  7524. +     char buf[MAXLINE];
  7525. +     static char hbuf[MAXDNAME];
  7526. +     fname = getenv("HOSTALIASES");
  7527. +     if (fname == NULL || (fp = fopen(fname, "r")) == NULL)
  7528. +         return NULL;
  7529. +     while (fgets(buf, sizeof buf, fp) != NULL)
  7530. +     {
  7531. +         for (p = buf; p != '\0' && !(isascii(*p) && isspace(*p)); p++)
  7532. +             continue;
  7533. +         if (*p == 0)
  7534. +         {
  7535. +             /* syntax error */
  7536. +             continue;
  7537. +         }
  7538. +         *p++ = '\0';
  7539. +         if (strcasecmp(buf, host) == 0)
  7540. +             break;
  7541. +     }
  7542. +     if (feof(fp))
  7543. +     {
  7544. +         /* no match */
  7545. +         fclose(fp);
  7546. +         return NULL;
  7547. +     }
  7548. +     /* got a match; extract the equivalent name */
  7549. +     while (*p != '\0' && isascii(*p) && isspace(*p))
  7550. +         p++;
  7551. +     host = p;
  7552. +     while (*p != '\0' && !(isascii(*p) && isspace(*p)))
  7553. +         p++;
  7554. +     *p = '\0';
  7555. +     strncpy(hbuf, host, sizeof hbuf - 1);
  7556. +     hbuf[sizeof hbuf - 1] = '\0';
  7557. +     return hbuf;
  7558. + }
  7559.   
  7560.   #else /* not NAMED_BIND */
  7561.   
  7562. *** src/envelope.c.OLD    Tue Nov  9 14:38:25 1993
  7563. --- src/envelope.c    Sun Jan  9 09:22:39 1994
  7564. ***************
  7565. *** 33,39 ****
  7566.    */
  7567.   
  7568.   #ifndef lint
  7569. ! static char sccsid[] = "@(#)envelope.c    8.17 (Berkeley) 10/31/93";
  7570.   #endif /* not lint */
  7571.   
  7572.   #include "sendmail.h"
  7573. --- 33,39 ----
  7574.    */
  7575.   
  7576.   #ifndef lint
  7577. ! static char sccsid[] = "@(#)envelope.c    8.28 (Berkeley) 1/9/94";
  7578.   #endif /* not lint */
  7579.   
  7580.   #include "sendmail.h"
  7581. ***************
  7582. *** 110,116 ****
  7583.       {
  7584.           printf("dropenvelope %x: id=", e);
  7585.           xputs(e->e_id);
  7586. !         printf(", flags=%o\n", e->e_flags);
  7587.           if (tTd(50, 10))
  7588.           {
  7589.               printf("sendq=");
  7590. --- 110,116 ----
  7591.       {
  7592.           printf("dropenvelope %x: id=", e);
  7593.           xputs(e->e_id);
  7594. !         printf(", flags=0x%x\n", e->e_flags);
  7595.           if (tTd(50, 10))
  7596.           {
  7597.               printf("sendq=");
  7598. ***************
  7599. *** 123,132 ****
  7600.           return;
  7601.   
  7602.   #ifdef LOG
  7603.       if (LogLevel > 84)
  7604. !         syslog(LOG_DEBUG, "dropenvelope, id=%s, flags=%o, pid=%d",
  7605.                     id, e->e_flags, getpid());
  7606.   #endif /* LOG */
  7607.   
  7608.       /* post statistics */
  7609.       poststats(StatFile);
  7610. --- 123,135 ----
  7611.           return;
  7612.   
  7613.   #ifdef LOG
  7614. +     if (LogLevel > 4 && bitset(EF_LOGSENDER, e->e_flags))
  7615. +         logsender(e, NULL);
  7616.       if (LogLevel > 84)
  7617. !         syslog(LOG_DEBUG, "dropenvelope, id=%s, flags=0x%x, pid=%d",
  7618.                     id, e->e_flags, getpid());
  7619.   #endif /* LOG */
  7620. +     e->e_flags &= ~EF_LOGSENDER;
  7621.   
  7622.       /* post statistics */
  7623.       poststats(StatFile);
  7624. ***************
  7625. *** 214,219 ****
  7626. --- 217,223 ----
  7627.   
  7628.           (void) sendtolist(e->e_receiptto, NULLADDR, &rlist, e);
  7629.           (void) returntosender("Return receipt", rlist, FALSE, e);
  7630. +         e->e_flags &= ~EF_SENDRECEIPT;
  7631.       }
  7632.   
  7633.       /*
  7634. ***************
  7635. *** 272,280 ****
  7636.           (void) xfclose(e->e_dfp, "dropenvelope", e->e_df);
  7637.       e->e_dfp = NULL;
  7638.       e->e_id = e->e_df = NULL;
  7639. - #ifdef XDEBUG
  7640. -     checkfd012("dropenvelope");
  7641. - #endif
  7642.   }
  7643.    /*
  7644.   **  CLEARENVELOPE -- clear an envelope without unlocking
  7645. --- 276,281 ----
  7646. ***************
  7647. *** 583,589 ****
  7648.       **    Username can return errno != 0 on non-errors.
  7649.       */
  7650.   
  7651. !     if (bitset(EF_QUEUERUN, e->e_flags) || OpMode == MD_SMTP)
  7652.           realname = from;
  7653.       if (realname == NULL || realname[0] == '\0')
  7654.           realname = username();
  7655. --- 584,591 ----
  7656.       **    Username can return errno != 0 on non-errors.
  7657.       */
  7658.   
  7659. !     if (bitset(EF_QUEUERUN, e->e_flags) || OpMode == MD_SMTP ||
  7660. !         OpMode == MD_DAEMON)
  7661.           realname = from;
  7662.       if (realname == NULL || realname[0] == '\0')
  7663.           realname = username();
  7664. ***************
  7665. *** 619,625 ****
  7666.               }
  7667.               syslog(LOG_NOTICE,
  7668.                   "setsender: %s: invalid or unparseable, received from %s",
  7669. !                 from, p);
  7670.           }
  7671.   # endif /* LOG */
  7672.           if (from != NULL)
  7673. --- 621,627 ----
  7674.               }
  7675.               syslog(LOG_NOTICE,
  7676.                   "setsender: %s: invalid or unparseable, received from %s",
  7677. !                 shortenstring(from, 83), p);
  7678.           }
  7679.   # endif /* LOG */
  7680.           if (from != NULL)
  7681. ***************
  7682. *** 681,687 ****
  7683.                   **  We have an alternate address for the sender
  7684.                   */
  7685.   
  7686. !                 pvp = prescan(p, '\0', pvpbuf, NULL);
  7687.               }
  7688.   # endif /* USERDB */
  7689.           }
  7690. --- 683,689 ----
  7691.                   **  We have an alternate address for the sender
  7692.                   */
  7693.   
  7694. !                 pvp = prescan(p, '\0', pvpbuf, sizeof pvpbuf, NULL);
  7695.               }
  7696.   # endif /* USERDB */
  7697.           }
  7698. ***************
  7699. *** 700,705 ****
  7700. --- 702,708 ----
  7701.               /* extract user and group id */
  7702.               e->e_from.q_uid = pw->pw_uid;
  7703.               e->e_from.q_gid = pw->pw_gid;
  7704. +             e->e_from.q_flags |= QGOODUID;
  7705.   
  7706.               /* extract full name from passwd file */
  7707.               if (FullName == NULL && pw->pw_gecos != NULL &&
  7708. ***************
  7709. *** 714,725 ****
  7710.           if (FullName != NULL && !internal)
  7711.               define('x', FullName, e);
  7712.       }
  7713. !     else if (!internal)
  7714.       {
  7715.           if (e->e_from.q_home == NULL)
  7716.               e->e_from.q_home = getenv("HOME");
  7717.           e->e_from.q_uid = RealUid;
  7718.           e->e_from.q_gid = RealGid;
  7719.       }
  7720.   
  7721.       /*
  7722. --- 717,729 ----
  7723.           if (FullName != NULL && !internal)
  7724.               define('x', FullName, e);
  7725.       }
  7726. !     else if (!internal && OpMode != MD_DAEMON)
  7727.       {
  7728.           if (e->e_from.q_home == NULL)
  7729.               e->e_from.q_home = getenv("HOME");
  7730.           e->e_from.q_uid = RealUid;
  7731.           e->e_from.q_gid = RealGid;
  7732. +         e->e_from.q_flags |= QGOODUID;
  7733.       }
  7734.   
  7735.       /*
  7736. ***************
  7737. *** 728,734 ****
  7738.       */
  7739.   
  7740.       if (pvp == NULL)
  7741. !         pvp = prescan(from, '\0', pvpbuf, NULL);
  7742.       if (pvp == NULL)
  7743.       {
  7744.           /* don't need to give error -- prescan did that already */
  7745. --- 732,738 ----
  7746.       */
  7747.   
  7748.       if (pvp == NULL)
  7749. !         pvp = prescan(from, delimchar, pvpbuf, sizeof pvpbuf, NULL);
  7750.       if (pvp == NULL)
  7751.       {
  7752.           /* don't need to give error -- prescan did that already */
  7753. ***************
  7754. *** 738,746 ****
  7755.   # endif
  7756.           finis();
  7757.       }
  7758. !     (void) rewrite(pvp, 3, e);
  7759. !     (void) rewrite(pvp, 1, e);
  7760. !     (void) rewrite(pvp, 4, e);
  7761.       bp = buf + 1;
  7762.       cataddr(pvp, NULL, bp, sizeof buf - 2, '\0');
  7763.       if (*bp == '@')
  7764. --- 742,750 ----
  7765.   # endif
  7766.           finis();
  7767.       }
  7768. !     (void) rewrite(pvp, 3, 0, e);
  7769. !     (void) rewrite(pvp, 1, 0, e);
  7770. !     (void) rewrite(pvp, 4, 0, e);
  7771.       bp = buf + 1;
  7772.       cataddr(pvp, NULL, bp, sizeof buf - 2, '\0');
  7773.       if (*bp == '@')
  7774. ***************
  7775. *** 753,759 ****
  7776.       define('f', e->e_sender, e);
  7777.   
  7778.       /* save the domain spec if this mailer wants it */
  7779. !     if (!internal && e->e_from.q_mailer != NULL &&
  7780.           bitnset(M_CANONICAL, e->e_from.q_mailer->m_flags))
  7781.       {
  7782.           extern char **copyplist();
  7783. --- 757,763 ----
  7784.       define('f', e->e_sender, e);
  7785.   
  7786.       /* save the domain spec if this mailer wants it */
  7787. !     if (e->e_from.q_mailer != NULL &&
  7788.           bitnset(M_CANONICAL, e->e_from.q_mailer->m_flags))
  7789.       {
  7790.           extern char **copyplist();
  7791. *** src/err.c.OLD    Sun Nov  7 12:03:39 1993
  7792. --- src/err.c    Sat Jan  8 17:29:31 1994
  7793. ***************
  7794. *** 33,39 ****
  7795.    */
  7796.   
  7797.   #ifndef lint
  7798. ! static char sccsid[] = "@(#)err.c    8.14 (Berkeley) 10/29/93";
  7799.   #endif /* not lint */
  7800.   
  7801.   # include "sendmail.h"
  7802. --- 33,39 ----
  7803.    */
  7804.   
  7805.   #ifndef lint
  7806. ! static char sccsid[] = "@(#)err.c    8.19 (Berkeley) 1/8/94";
  7807.   #endif /* not lint */
  7808.   
  7809.   # include "sendmail.h"
  7810. ***************
  7811. *** 159,166 ****
  7812.   #endif
  7813.   {
  7814.       VA_LOCAL_DECL
  7815. -     extern char SuprErrs;
  7816. -     extern int errno;
  7817.   
  7818.       if (SuprErrs)
  7819.           return;
  7820. --- 159,164 ----
  7821. ***************
  7822. *** 287,299 ****
  7823.           msg[0] = '5';
  7824.   
  7825.       (void) fflush(stdout);
  7826. !     if (OpMode == MD_SMTP)
  7827.           fprintf(OutChannel, "%s\r\n", msg);
  7828.       else
  7829.           fprintf(OutChannel, "%s\n", &msg[4]);
  7830.       if (TrafficLogFile != NULL)
  7831.           fprintf(TrafficLogFile, "%05d >>> %s\n", getpid(),
  7832. !             OpMode == MD_SMTP ? msg : &msg[4]);
  7833.       if (msg[3] == ' ')
  7834.           (void) fflush(OutChannel);
  7835.       if (!ferror(OutChannel))
  7836. --- 285,297 ----
  7837.           msg[0] = '5';
  7838.   
  7839.       (void) fflush(stdout);
  7840. !     if (OpMode == MD_SMTP || OpMode == MD_DAEMON)
  7841.           fprintf(OutChannel, "%s\r\n", msg);
  7842.       else
  7843.           fprintf(OutChannel, "%s\n", &msg[4]);
  7844.       if (TrafficLogFile != NULL)
  7845.           fprintf(TrafficLogFile, "%05d >>> %s\n", getpid(),
  7846. !             (OpMode == MD_SMTP || OpMode == MD_DAEMON) ? msg : &msg[4]);
  7847.       if (msg[3] == ' ')
  7848.           (void) fflush(OutChannel);
  7849.       if (!ferror(OutChannel))
  7850. ***************
  7851. *** 449,454 ****
  7852. --- 447,453 ----
  7853.   errstring(errno)
  7854.       int errno;
  7855.   {
  7856. +     char *dnsmsg;
  7857.       static char buf[MAXLINE];
  7858.   # ifndef ERRLIST_PREDEFINED
  7859.       extern char *sys_errlist[];
  7860. ***************
  7861. *** 458,465 ****
  7862.       extern char *SmtpPhase;
  7863.   # endif /* SMTP */
  7864.   
  7865. - # ifdef DAEMON
  7866. - # ifdef ETIMEDOUT
  7867.       /*
  7868.       **  Handle special network error codes.
  7869.       **
  7870. --- 457,462 ----
  7871. ***************
  7872. *** 466,473 ****
  7873. --- 463,472 ----
  7874.       **    These are 4.2/4.3bsd specific; they should be in daemon.c.
  7875.       */
  7876.   
  7877. +     dnsmsg = NULL;
  7878.       switch (errno)
  7879.       {
  7880. + # if defined(DAEMON) && defined(ETIMEDOUT)
  7881.         case ETIMEDOUT:
  7882.         case ECONNRESET:
  7883.           (void) strcpy(buf, sys_errlist[errno]);
  7884. ***************
  7885. *** 494,499 ****
  7886. --- 493,499 ----
  7887.               break;
  7888.           (void) sprintf(buf, "Connection refused by %s", CurHostName);
  7889.           return (buf);
  7890. + # endif
  7891.   
  7892.         case EOPENTIMEOUT:
  7893.           return "Timeout on file open";
  7894. ***************
  7895. *** 500,519 ****
  7896.   
  7897.   # ifdef NAMED_BIND
  7898.         case HOST_NOT_FOUND + E_DNSBASE:
  7899. !         return ("Name server: host not found");
  7900.   
  7901.         case TRY_AGAIN + E_DNSBASE:
  7902. !         return ("Name server: host name lookup failure");
  7903.   
  7904.         case NO_RECOVERY + E_DNSBASE:
  7905. !         return ("Name server: non-recoverable error");
  7906.   
  7907.         case NO_DATA + E_DNSBASE:
  7908. !         return ("Name server: no data known for name");
  7909.   # endif
  7910.       }
  7911. ! # endif
  7912. ! # endif
  7913.   
  7914.       if (errno > 0 && errno < sys_nerr)
  7915.           return (sys_errlist[errno]);
  7916. --- 500,537 ----
  7917.   
  7918.   # ifdef NAMED_BIND
  7919.         case HOST_NOT_FOUND + E_DNSBASE:
  7920. !         dnsmsg = "host not found";
  7921. !         break;
  7922.   
  7923.         case TRY_AGAIN + E_DNSBASE:
  7924. !         dnsmsg = "host name lookup failure";
  7925. !         break;
  7926.   
  7927.         case NO_RECOVERY + E_DNSBASE:
  7928. !         dnsmsg = "non-recoverable error";
  7929. !         break;
  7930.   
  7931.         case NO_DATA + E_DNSBASE:
  7932. !         dnsmsg = "no data known";
  7933. !         break;
  7934.   # endif
  7935. +       case EPERM:
  7936. +         /* SunOS gives "Not owner" -- this is the POSIX message */
  7937. +         return "Operation not permitted";
  7938.       }
  7939. !     if (dnsmsg != NULL)
  7940. !     {
  7941. !         (void) strcpy(buf, "Name server: ");
  7942. !         if (CurHostName != NULL)
  7943. !         {
  7944. !             (void) strcat(buf, CurHostName);
  7945. !             (void) strcat(buf, ": ");
  7946. !         }
  7947. !         (void) strcat(buf, dnsmsg);
  7948. !         return buf;
  7949. !     }
  7950.   
  7951.       if (errno > 0 && errno < sys_nerr)
  7952.           return (sys_errlist[errno]);
  7953. *** src/features.linux.h.OLD    Thu Dec 16 16:02:45 1993
  7954. --- src/features.linux.h    Thu Dec  9 13:43:51 1993
  7955. ***************
  7956. *** 0 ****
  7957. --- 1,14 ----
  7958. + /*
  7959. + **  This should be renamed features.h on Linux.  DO NOT USE IT
  7960. + **  on any other system.
  7961. + */
  7962. + #include_next <features.h>
  7963. + #undef  __USE_POSIX2
  7964. + #ifndef __USE_POSIX
  7965. + #define __USE_POSIX
  7966. + #endif
  7967. + #ifndef __USE_BSD
  7968. + #define __USE_BSD
  7969. + #endif
  7970. *** src/headers.c.OLD    Thu Dec  9 13:50:15 1993
  7971. --- src/headers.c    Wed Jan 12 12:38:49 1994
  7972. ***************
  7973. *** 33,39 ****
  7974.    */
  7975.   
  7976.   #ifndef lint
  7977. ! static char sccsid[] = "@(#)headers.c    8.13 (Berkeley) 10/24/93";
  7978.   #endif /* not lint */
  7979.   
  7980.   # include <errno.h>
  7981. --- 33,39 ----
  7982.    */
  7983.   
  7984.   #ifndef lint
  7985. ! static char sccsid[] = "@(#)headers.c    8.22 (Berkeley) 1/13/94";
  7986.   #endif /* not lint */
  7987.   
  7988.   # include <errno.h>
  7989. ***************
  7990. *** 371,376 ****
  7991. --- 371,381 ----
  7992.       else
  7993.           define('u', NULL, e);
  7994.   
  7995. +     /* full name of from person */
  7996. +     p = hvalue("full-name", e);
  7997. +     if (p != NULL)
  7998. +         define('x', p, e);
  7999.       if (tTd(32, 1))
  8000.           printf("----- collected header -----\n");
  8001.       msgid = "<none>";
  8002. ***************
  8003. *** 395,401 ****
  8004.           }
  8005.   
  8006.           if (tTd(32, 1))
  8007. !             printf("%s: %s\n", h->h_field, h->h_value);
  8008.   
  8009.           /* count the number of times it has been processed */
  8010.           if (bitset(H_TRACE, h->h_flags))
  8011. --- 400,410 ----
  8012.           }
  8013.   
  8014.           if (tTd(32, 1))
  8015. !         {
  8016. !             printf("%s: ", h->h_field);
  8017. !             xputs(h->h_value);
  8018. !             printf("\n");
  8019. !         }
  8020.   
  8021.           /* count the number of times it has been processed */
  8022.           if (bitset(H_TRACE, h->h_flags))
  8023. ***************
  8024. *** 453,463 ****
  8025.                    - e->e_class * WkClassFact
  8026.                    + e->e_nrcpts * WkRecipFact;
  8027.   
  8028. -     /* full name of from person */
  8029. -     p = hvalue("full-name", e);
  8030. -     if (p != NULL)
  8031. -         define('x', p, e);
  8032.       /* date message originated */
  8033.       p = hvalue("posted-date", e);
  8034.       if (p == NULL)
  8035. --- 462,467 ----
  8036. ***************
  8037. *** 471,518 ****
  8038.   
  8039.   # ifdef LOG
  8040.       if (full && LogLevel > 4)
  8041. !     {
  8042. !         char *name;
  8043. !         register char *sbp;
  8044. !         char hbuf[MAXNAME];
  8045. !         char sbuf[MAXLINE];
  8046.   
  8047. !         if (bitset(EF_RESPONSE, e->e_flags))
  8048. !             name = "[RESPONSE]";
  8049. !         else if ((name = macvalue('_', e)) != NULL)
  8050. !             ;
  8051. !         else if (RealHostName[0] == '[')
  8052. !             name = RealHostName;
  8053. !         else
  8054.           {
  8055. !             name = hbuf;
  8056. !             (void) sprintf(hbuf, "%.80s", RealHostName);
  8057. !             if (RealHostAddr.sa.sa_family != 0)
  8058. !             {
  8059. !                 p = &hbuf[strlen(hbuf)];
  8060. !                 (void) sprintf(p, " (%s)",
  8061. !                     anynet_ntoa(&RealHostAddr));
  8062. !             }
  8063.           }
  8064.   
  8065. !         /* some versions of syslog only take 5 printf args */
  8066. !         sbp = sbuf;
  8067. !         sprintf(sbp, "from=%.200s, size=%ld, class=%d, pri=%ld, nrcpts=%d, msgid=%.100s",
  8068. !             e->e_from.q_paddr, e->e_msgsize, e->e_class,
  8069. !             e->e_msgpriority, e->e_nrcpts, msgid);
  8070.           sbp += strlen(sbp);
  8071. -         if (e->e_bodytype != NULL)
  8072. -         {
  8073. -             (void) sprintf(sbp, ", bodytype=%.20s", e->e_bodytype);
  8074. -             sbp += strlen(sbp);
  8075. -         }
  8076. -         p = macvalue('r', e);
  8077. -         if (p != NULL)
  8078. -             (void) sprintf(sbp, ", proto=%.20s", p);
  8079. -         syslog(LOG_INFO, "%s: %s, relay=%s",
  8080. -             e->e_id, sbuf, name);
  8081.       }
  8082. ! # endif /* LOG */
  8083.   }
  8084.    /*
  8085.   **  PRIENCODE -- encode external priority names into internal values.
  8086. --- 475,571 ----
  8087.   
  8088.   # ifdef LOG
  8089.       if (full && LogLevel > 4)
  8090. !         logsender(e, msgid);
  8091. ! # endif /* LOG */
  8092. !     e->e_flags &= ~EF_LOGSENDER;
  8093. ! }
  8094. !  /*
  8095. ! **  LOGSENDER -- log sender information
  8096. ! **
  8097. ! **    Parameters:
  8098. ! **        e -- the envelope to log
  8099. ! **        msgid -- the message id
  8100. ! **
  8101. ! **    Returns:
  8102. ! **        none
  8103. ! */
  8104.   
  8105. ! logsender(e, msgid)
  8106. !     register ENVELOPE *e;
  8107. !     char *msgid;
  8108. ! {
  8109. !     char *name;
  8110. !     register char *sbp;
  8111. !     register char *p;
  8112. !     char hbuf[MAXNAME];
  8113. !     char sbuf[MAXLINE];
  8114. !     if (bitset(EF_RESPONSE, e->e_flags))
  8115. !         name = "[RESPONSE]";
  8116. !     else if ((name = macvalue('_', e)) != NULL)
  8117. !         ;
  8118. !     else if (RealHostName[0] == '[')
  8119. !         name = RealHostName;
  8120. !     else
  8121. !     {
  8122. !         name = hbuf;
  8123. !         (void) sprintf(hbuf, "%.80s", RealHostName);
  8124. !         if (RealHostAddr.sa.sa_family != 0)
  8125.           {
  8126. !             p = &hbuf[strlen(hbuf)];
  8127. !             (void) sprintf(p, " (%s)",
  8128. !                 anynet_ntoa(&RealHostAddr));
  8129.           }
  8130. +     }
  8131.   
  8132. !     /* some versions of syslog only take 5 printf args */
  8133. ! #  if (SYSLOG_BUFSIZE) >= 256
  8134. !     sbp = sbuf;
  8135. !     sprintf(sbp, "from=%.200s, size=%ld, class=%d, pri=%ld, nrcpts=%d",
  8136. !         e->e_from.q_paddr, e->e_msgsize, e->e_class,
  8137. !         e->e_msgpriority, e->e_nrcpts);
  8138. !     sbp += strlen(sbp);
  8139. !     if (msgid != NULL)
  8140. !     {
  8141. !         sprintf(sbp, ", msgid=%.100s", msgid);
  8142.           sbp += strlen(sbp);
  8143.       }
  8144. !     if (e->e_bodytype != NULL)
  8145. !     {
  8146. !         (void) sprintf(sbp, ", bodytype=%.20s", e->e_bodytype);
  8147. !         sbp += strlen(sbp);
  8148. !     }
  8149. !     p = macvalue('r', e);
  8150. !     if (p != NULL)
  8151. !         (void) sprintf(sbp, ", proto=%.20s", p);
  8152. !     syslog(LOG_INFO, "%s: %s, relay=%s",
  8153. !         e->e_id, sbuf, name);
  8154. ! #  else            /* short syslog buffer */
  8155. !     syslog(LOG_INFO, "%s: from=%s",
  8156. !         e->e_id, shortenstring(e->e_from.q_paddr, 83));
  8157. !     syslog(LOG_INFO, "%s: size=%ld, class=%ld, pri=%ld, nrcpts=%d",
  8158. !         e->e_id, e->e_msgsize, e->e_class,
  8159. !         e->e_msgpriority, e->e_nrcpts);
  8160. !     if (msgid != NULL)
  8161. !         syslog(LOG_INFO, "%s: msgid=%s", e->e_id, msgid);
  8162. !     sbp = sbuf;
  8163. !     sprintf(sbp, "%s:", e->e_id);
  8164. !     sbp += strlen(sbp);
  8165. !     if (e->e_bodytype != NULL)
  8166. !     {
  8167. !         sprintf(sbp, " bodytype=%s,", e->e_bodytype);
  8168. !         sbp += strlen(sbp);
  8169. !     }
  8170. !     p = macvalue('r', e);
  8171. !     if (p != NULL)
  8172. !     {
  8173. !         sprintf(sbp, " proto=%s,", p);
  8174. !         sbp += strlen(sbp);
  8175. !     }
  8176. !     syslog(LOG_INFO, "%s relay=%s", sbuf, name);
  8177. ! #  endif
  8178.   }
  8179.    /*
  8180.   **  PRIENCODE -- encode external priority names into internal values.
  8181. ***************
  8182. *** 639,645 ****
  8183.           }
  8184.   
  8185.           /* check for quoted strings */
  8186. !         if (c == '"')
  8187.           {
  8188.               qmode = !qmode;
  8189.               if (copylev > 0 && !skipping)
  8190. --- 692,698 ----
  8191.           }
  8192.   
  8193.           /* check for quoted strings */
  8194. !         if (c == '"' && cmtlev <= 0)
  8195.           {
  8196.               qmode = !qmode;
  8197.               if (copylev > 0 && !skipping)
  8198. ***************
  8199. *** 683,693 ****
  8200.           else if (c == ')')
  8201.           {
  8202.               /* syntax error: unmatched ) */
  8203. !             if (!skipping)
  8204.                   bp--;
  8205.           }
  8206.   
  8207.           /* check for characters that may have to be quoted */
  8208.           if (strchr(".'@,;:\\()[]", c) != NULL)
  8209.           {
  8210. --- 736,745 ----
  8211.           else if (c == ')')
  8212.           {
  8213.               /* syntax error: unmatched ) */
  8214. !             if (copylev > 0 && !skipping)
  8215.                   bp--;
  8216.           }
  8217.   
  8218.           /* check for characters that may have to be quoted */
  8219.           if (strchr(".'@,;:\\()[]", c) != NULL)
  8220.           {
  8221. ***************
  8222. *** 864,882 ****
  8223.                   printf(" (skipped (resent))\n");
  8224.               continue;
  8225.           }
  8226. -         if (tTd(34, 11))
  8227. -             printf("\n");
  8228.   
  8229.           p = h->h_value;
  8230.           if (bitset(H_DEFAULT, h->h_flags))
  8231.           {
  8232. -             /* macro expand value if generated internally */
  8233.               expand(p, buf, &buf[sizeof buf], e);
  8234.               p = buf;
  8235.               if (p == NULL || *p == '\0')
  8236.                   continue;
  8237.           }
  8238.   
  8239.           if (bitset(H_FROM|H_RCPT, h->h_flags))
  8240.           {
  8241.               /* address field */
  8242. --- 916,939 ----
  8243.                   printf(" (skipped (resent))\n");
  8244.               continue;
  8245.           }
  8246.   
  8247. +         /* macro expand value if generated internally */
  8248.           p = h->h_value;
  8249.           if (bitset(H_DEFAULT, h->h_flags))
  8250.           {
  8251.               expand(p, buf, &buf[sizeof buf], e);
  8252.               p = buf;
  8253.               if (p == NULL || *p == '\0')
  8254. +             {
  8255. +                 if (tTd(34, 11))
  8256. +                     printf(" (skipped -- null value)\n");
  8257.                   continue;
  8258. +             }
  8259.           }
  8260.   
  8261. +         if (tTd(34, 11))
  8262. +             printf("\n");
  8263.           if (bitset(H_FROM|H_RCPT, h->h_flags))
  8264.           {
  8265.               /* address field */
  8266. ***************
  8267. *** 980,986 ****
  8268.               auto char *oldp;
  8269.               char pvpbuf[PSBUFSIZE];
  8270.   
  8271. !             (void) prescan(p, oldstyle ? ' ' : ',', pvpbuf, &oldp);
  8272.               p = oldp;
  8273.   
  8274.               /* look to see if we have an at sign */
  8275. --- 1037,1044 ----
  8276.               auto char *oldp;
  8277.               char pvpbuf[PSBUFSIZE];
  8278.   
  8279. !             (void) prescan(p, oldstyle ? ' ' : ',', pvpbuf,
  8280. !                        sizeof pvpbuf, &oldp);
  8281.               p = oldp;
  8282.   
  8283.               /* look to see if we have an at sign */
  8284. *** src/main.c.OLD    Sun Nov  7 16:45:33 1993
  8285. --- src/main.c    Sun Jan  9 11:09:20 1994
  8286. ***************
  8287. *** 39,45 ****
  8288.   #endif /* not lint */
  8289.   
  8290.   #ifndef lint
  8291. ! static char sccsid[] = "@(#)main.c    8.33 (Berkeley) 10/24/93";
  8292.   #endif /* not lint */
  8293.   
  8294.   #define    _DEFINE
  8295. --- 39,45 ----
  8296.   #endif /* not lint */
  8297.   
  8298.   #ifndef lint
  8299. ! static char sccsid[] = "@(#)main.c    8.46 (Berkeley) 1/9/94";
  8300.   #endif /* not lint */
  8301.   
  8302.   #define    _DEFINE
  8303. ***************
  8304. *** 155,160 ****
  8305. --- 155,161 ----
  8306.       extern char *getcfname();
  8307.       extern char *optarg;
  8308.       extern char **environ;
  8309. +     extern void dumpstate();
  8310.   
  8311.       /*
  8312.       **  Check to see if we reentered.
  8313. ***************
  8314. *** 170,177 ****
  8315.       reenter = TRUE;
  8316.   
  8317.       /* do machine-dependent initializations */
  8318. !     init_md();
  8319.   
  8320.       /* in 4.4BSD, the table can be huge; impose a reasonable limit */
  8321.       DtableSize = getdtsize();
  8322.       if (DtableSize > 256)
  8323. --- 171,183 ----
  8324.       reenter = TRUE;
  8325.   
  8326.       /* do machine-dependent initializations */
  8327. !     init_md(argc, argv);
  8328.   
  8329. +     /* arrange to dump state on signal */
  8330. + #ifdef SIGUSR1
  8331. +     setsignal(SIGUSR1, dumpstate);
  8332. + #endif
  8333.       /* in 4.4BSD, the table can be huge; impose a reasonable limit */
  8334.       DtableSize = getdtsize();
  8335.       if (DtableSize > 256)
  8336. ***************
  8337. *** 253,265 ****
  8338.   
  8339.   #if defined(__osf__) || defined(_AIX3)
  8340.   # define OPTIONS    "B:b:C:cd:e:F:f:h:Iimno:p:q:r:sTtvX:x"
  8341. - #else
  8342. - # if defined(ultrix)
  8343. - #  define OPTIONS    "B:b:C:cd:e:F:f:h:IiM:mno:p:q:r:sTtvX:"
  8344. - # else
  8345. - #  define OPTIONS    "B:b:C:cd:e:F:f:h:Iimno:p:q:r:sTtvX:"
  8346. - # endif
  8347.   #endif
  8348.       while ((j = getopt(argc, argv, OPTIONS)) != EOF)
  8349.       {
  8350.           switch (j)
  8351. --- 259,274 ----
  8352.   
  8353.   #if defined(__osf__) || defined(_AIX3)
  8354.   # define OPTIONS    "B:b:C:cd:e:F:f:h:Iimno:p:q:r:sTtvX:x"
  8355.   #endif
  8356. + #if defined(ultrix)
  8357. + # define OPTIONS    "B:b:C:cd:e:F:f:h:IiM:mno:p:q:r:sTtvX:"
  8358. + #endif
  8359. + #if defined(NeXT)
  8360. + # define OPTIONS    "B:b:C:cd:e:F:f:h:IimnOo:p:q:r:sTtvX:"
  8361. + #endif
  8362. + #ifndef OPTIONS
  8363. + # define OPTIONS    "B:b:C:cd:e:F:f:h:Iimno:p:q:r:sTtvX:"
  8364. + #endif
  8365.       while ((j = getopt(argc, argv, OPTIONS)) != EOF)
  8366.       {
  8367.           switch (j)
  8368. ***************
  8369. *** 334,343 ****
  8370.   
  8371.           if (tTd(0, 4))
  8372.               printf("canonical name: %s\n", jbuf);
  8373. -         p = newstr(jbuf);
  8374.           define('w', newstr(jbuf), CurEnv);    /* must be new string */
  8375. !         define('j', p, CurEnv);
  8376. !         setclass('w', p);
  8377.   
  8378.           p = strchr(jbuf, '.');
  8379.           if (p != NULL)
  8380. --- 343,351 ----
  8381.   
  8382.           if (tTd(0, 4))
  8383.               printf("canonical name: %s\n", jbuf);
  8384.           define('w', newstr(jbuf), CurEnv);    /* must be new string */
  8385. !         define('j', newstr(jbuf), CurEnv);
  8386. !         setclass('w', jbuf);
  8387.   
  8388.           p = strchr(jbuf, '.');
  8389.           if (p != NULL)
  8390. ***************
  8391. *** 360,365 ****
  8392. --- 368,375 ----
  8393.               p = utsname.nodename;
  8394.           else
  8395.           {
  8396. +             if (tTd(0, 22))
  8397. +                 printf("uname failed (%s)\n", errstring(errno));
  8398.               makelower(jbuf);
  8399.               p = jbuf;
  8400.           }
  8401. ***************
  8402. *** 367,372 ****
  8403. --- 377,383 ----
  8404.               printf("UUCP nodename: %s\n", p);
  8405.           p = newstr(p);
  8406.           define('k', p, CurEnv);
  8407. +         setclass('k', p);
  8408.           setclass('w', p);
  8409.       }
  8410.       while (av != NULL && *av != NULL)
  8411. ***************
  8412. *** 586,591 ****
  8413. --- 597,606 ----
  8414.             case 'x':    /* random flag that OSF/1 & AIX mailx passes */
  8415.               break;
  8416.   # endif
  8417. + # if defined(NeXT)
  8418. +           case 'O':    /* random flag that NeXT Mail.app passes */
  8419. +             break;
  8420. + # endif
  8421.   
  8422.             default:
  8423.               ExitStat = EX_USAGE;
  8424. ***************
  8425. *** 601,606 ****
  8426. --- 616,624 ----
  8427.       **    Extract special fields for local use.
  8428.       */
  8429.   
  8430. + #ifdef XDEBUG
  8431. +     checkfd012("before readcf");
  8432. + #endif
  8433.       readcf(getcfname(), safecf, CurEnv);
  8434.   
  8435.       if (tTd(0, 1))
  8436. ***************
  8437. *** 761,766 ****
  8438. --- 779,788 ----
  8439.           exit(ExitStat);
  8440.       }
  8441.   
  8442. + #ifdef XDEBUG
  8443. +     checkfd012("before main() initmaps");
  8444. + #endif
  8445.       /*
  8446.       **  Do operation-mode-dependent initialization.
  8447.       */
  8448. ***************
  8449. *** 899,905 ****
  8450.               {
  8451.                   char pvpbuf[PSBUFSIZE];
  8452.   
  8453. !                 pvp = prescan(++p, ',', pvpbuf, &delimptr);
  8454.                   if (pvp == NULL)
  8455.                       continue;
  8456.                   p = q;
  8457. --- 921,928 ----
  8458.               {
  8459.                   char pvpbuf[PSBUFSIZE];
  8460.   
  8461. !                 pvp = prescan(++p, ',', pvpbuf, sizeof pvpbuf,
  8462. !                           &delimptr);
  8463.                   if (pvp == NULL)
  8464.                       continue;
  8465.                   p = q;
  8466. ***************
  8467. *** 907,913 ****
  8468.                   {
  8469.                       int stat;
  8470.   
  8471. !                     stat = rewrite(pvp, atoi(p), CurEnv);
  8472.                       if (stat != EX_OK)
  8473.                           printf("== Ruleset %s status %d\n",
  8474.                               p, stat);
  8475. --- 930,936 ----
  8476.                   {
  8477.                       int stat;
  8478.   
  8479. !                     stat = rewrite(pvp, atoi(p), 0, CurEnv);
  8480.                       if (stat != EX_OK)
  8481.                           printf("== Ruleset %s status %d\n",
  8482.                               p, stat);
  8483. ***************
  8484. *** 1005,1011 ****
  8485.       **  commands.  This will never return.
  8486.       */
  8487.   
  8488. !     if (OpMode == MD_SMTP)
  8489.           smtp(CurEnv);
  8490.   # endif /* SMTP */
  8491.   
  8492. --- 1028,1034 ----
  8493.       **  commands.  This will never return.
  8494.       */
  8495.   
  8496. !     if (OpMode == MD_SMTP || OpMode == MD_DAEMON)
  8497.           smtp(CurEnv);
  8498.   # endif /* SMTP */
  8499.   
  8500. ***************
  8501. *** 1325,1331 ****
  8502.   obsolete(argv)
  8503.       char *argv[];
  8504.   {
  8505. !     char *ap;
  8506.   
  8507.       while ((ap = *++argv) != NULL)
  8508.       {
  8509. --- 1348,1355 ----
  8510.   obsolete(argv)
  8511.       char *argv[];
  8512.   {
  8513. !     register char *ap;
  8514. !     register char *op;
  8515.   
  8516.       while ((ap = *++argv) != NULL)
  8517.       {
  8518. ***************
  8519. *** 1333,1342 ****
  8520.           if (ap[0] != '-' || ap[1] == '-')
  8521.               return;
  8522.   
  8523.           /* If -C doesn't have an argument, use sendmail.cf. */
  8524.   #define    __DEFPATH    "sendmail.cf"
  8525. !         if (ap[1] == 'C' && ap[2] == '\0' &&
  8526. !             (argv[1] == NULL || argv[1][0] == '-'))
  8527.           {
  8528.               *argv = xalloc(sizeof(__DEFPATH) + 2);
  8529.               argv[0][0] = '-';
  8530. --- 1357,1374 ----
  8531.           if (ap[0] != '-' || ap[1] == '-')
  8532.               return;
  8533.   
  8534. +         /* skip over options that do have a value */
  8535. +         op = strchr(OPTIONS, ap[1]);
  8536. +         if (op != NULL && *++op == ':' && ap[2] == '\0' &&
  8537. +             argv[1] != NULL && argv[1][0] != '-')
  8538. +         {
  8539. +             argv++;
  8540. +             continue;
  8541. +         }
  8542.           /* If -C doesn't have an argument, use sendmail.cf. */
  8543.   #define    __DEFPATH    "sendmail.cf"
  8544. !         if (ap[1] == 'C' && ap[2] == '\0')
  8545.           {
  8546.               *argv = xalloc(sizeof(__DEFPATH) + 2);
  8547.               argv[0][0] = '-';
  8548. ***************
  8549. *** 1345,1357 ****
  8550.           }
  8551.   
  8552.           /* If -q doesn't have an argument, run it once. */
  8553. !         if (ap[1] == 'q' && ap[2] == '\0' &&
  8554. !             (argv[1] == NULL || argv[1][0] == '-'))
  8555.               *argv = "-q0";
  8556.   
  8557.           /* if -d doesn't have an argument, use 0-99.1 */
  8558. !         if (ap[1] == 'd' && ap[2] == '\0' &&
  8559. !             (argv[1] == NULL || !isdigit(argv[1][0])))
  8560.               *argv = "-d0-99.1";
  8561.       }
  8562.   }
  8563. --- 1377,1387 ----
  8564.           }
  8565.   
  8566.           /* If -q doesn't have an argument, run it once. */
  8567. !         if (ap[1] == 'q' && ap[2] == '\0')
  8568.               *argv = "-q0";
  8569.   
  8570.           /* if -d doesn't have an argument, use 0-99.1 */
  8571. !         if (ap[1] == 'd' && ap[2] == '\0')
  8572.               *argv = "-d0-99.1";
  8573.       }
  8574.   }
  8575. ***************
  8576. *** 1396,1399 ****
  8577. --- 1426,1466 ----
  8578.           VA_END;
  8579.           addheader("X-Authentication-Warning", buf, e);
  8580.       }
  8581. + }
  8582. +  /*
  8583. + **  DUMPSTATE -- dump state on user signal
  8584. + **
  8585. + **    For debugging.
  8586. + */
  8587. + void
  8588. + dumpstate()
  8589. + {
  8590. + #ifdef LOG
  8591. +     register char *j = macvalue('j', CurEnv);
  8592. +     register STAB *s;
  8593. +     syslog(LOG_DEBUG, "--- dumping state on user signal: $j = %s ---", j);
  8594. +     s = stab(j, ST_CLASS, ST_FIND);
  8595. +     if (s == NULL || !bitnset('w', s->s_class))
  8596. +         syslog(LOG_DEBUG, "*** $j not in $=w ***");
  8597. +     syslog(LOG_DEBUG, "--- open file descriptors: ---");
  8598. +     printopenfds(TRUE);
  8599. +     syslog(LOG_DEBUG, "--- connection cache: ---");
  8600. +     mci_dump_all(TRUE);
  8601. +     if (RewriteRules[89] != NULL)
  8602. +     {
  8603. +         int stat;
  8604. +         register char **pvp;
  8605. +         char *pv[MAXATOM + 1];
  8606. +         pv[0] = NULL;
  8607. +         stat = rewrite(pv, 89, 0, CurEnv);
  8608. +         syslog(LOG_DEBUG, "--- ruleset 89 returns stat %d, pv: ---",
  8609. +             stat);
  8610. +         for (pvp = pv; *pvp != NULL; pvp++)
  8611. +             syslog(LOG_DEBUG, "%s", *pvp);
  8612. +     }
  8613. +     syslog(LOG_DEBUG, "--- end of state dump ---");
  8614. + #endif
  8615.   }
  8616. *** src/map.c.OLD    Thu Nov 25 08:16:17 1993
  8617. --- src/map.c    Sat Dec 11 08:26:17 1993
  8618. ***************
  8619. *** 33,39 ****
  8620.    */
  8621.   
  8622.   #ifndef lint
  8623. ! static char sccsid[] = "@(#)map.c    8.17 (Berkeley) 10/15/93";
  8624.   #endif /* not lint */
  8625.   
  8626.   #include "sendmail.h"
  8627. --- 33,39 ----
  8628.    */
  8629.   
  8630.   #ifndef lint
  8631. ! static char sccsid[] = "@(#)map.c    8.20 (Berkeley) 12/11/93";
  8632.   #endif /* not lint */
  8633.   
  8634.   #include "sendmail.h"
  8635. ***************
  8636. *** 336,342 ****
  8637.       checkfd012("entering initmaps");
  8638.   #endif
  8639.       CurEnv = e;
  8640. !     stabapply(map_init, rebuild);
  8641.   #ifdef XDEBUG
  8642.       checkfd012("exiting initmaps");
  8643.   #endif
  8644. --- 336,350 ----
  8645.       checkfd012("entering initmaps");
  8646.   #endif
  8647.       CurEnv = e;
  8648. !     if (rebuild)
  8649. !     {
  8650. !         stabapply(map_init, 1);
  8651. !         stabapply(map_init, 2);
  8652. !     }
  8653. !     else
  8654. !     {
  8655. !         stabapply(map_init, 0);
  8656. !     }
  8657.   #ifdef XDEBUG
  8658.       checkfd012("exiting initmaps");
  8659.   #endif
  8660. ***************
  8661. *** 358,368 ****
  8662.           return;
  8663.   
  8664.       if (tTd(38, 2))
  8665. !         printf("map_init(%s:%s)\n",
  8666.               map->map_class->map_cname == NULL ? "NULL" :
  8667.                   map->map_class->map_cname,
  8668. !             map->map_file == NULL ? "NULL" : map->map_file);
  8669.   
  8670.       /* if already open, close it (for nested open) */
  8671.       if (bitset(MF_OPEN, map->map_mflags))
  8672.       {
  8673. --- 366,385 ----
  8674.           return;
  8675.   
  8676.       if (tTd(38, 2))
  8677. !         printf("map_init(%s:%s, %d)\n",
  8678.               map->map_class->map_cname == NULL ? "NULL" :
  8679.                   map->map_class->map_cname,
  8680. !             map->map_file == NULL ? "NULL" : map->map_file,
  8681. !             rebuild);
  8682.   
  8683. +     if (rebuild == (bitset(MF_ALIAS, map->map_mflags) &&
  8684. +             bitset(MCF_REBUILDABLE, map->map_class->map_cflags) ? 1 : 2))
  8685. +     {
  8686. +         if (tTd(38, 3))
  8687. +             printf("\twrong pass\n");
  8688. +         return;
  8689. +     }
  8690.       /* if already open, close it (for nested open) */
  8691.       if (bitset(MF_OPEN, map->map_mflags))
  8692.       {
  8693. ***************
  8694. *** 370,380 ****
  8695.           map->map_mflags &= ~(MF_OPEN|MF_WRITABLE);
  8696.       }
  8697.   
  8698. !     if (rebuild)
  8699.       {
  8700. !         if (bitset(MF_ALIAS, map->map_mflags) &&
  8701. !             bitset(MCF_REBUILDABLE, map->map_class->map_cflags))
  8702. !             rebuildaliases(map, FALSE);
  8703.       }
  8704.       else
  8705.       {
  8706. --- 387,395 ----
  8707.           map->map_mflags &= ~(MF_OPEN|MF_WRITABLE);
  8708.       }
  8709.   
  8710. !     if (rebuild == 2)
  8711.       {
  8712. !         rebuildaliases(map, FALSE);
  8713.       }
  8714.       else
  8715.       {
  8716. ***************
  8717. *** 381,387 ****
  8718.           if (map->map_class->map_open(map, O_RDONLY))
  8719.           {
  8720.               if (tTd(38, 4))
  8721. !                 printf("%s:%s: valid\n",
  8722.                       map->map_class->map_cname == NULL ? "NULL" :
  8723.                           map->map_class->map_cname,
  8724.                       map->map_file == NULL ? "NULL" :
  8725. --- 396,402 ----
  8726.           if (map->map_class->map_open(map, O_RDONLY))
  8727.           {
  8728.               if (tTd(38, 4))
  8729. !                 printf("\t%s:%s: valid\n",
  8730.                       map->map_class->map_cname == NULL ? "NULL" :
  8731.                           map->map_class->map_cname,
  8732.                       map->map_file == NULL ? "NULL" :
  8733. ***************
  8734. *** 389,395 ****
  8735.               map->map_mflags |= MF_OPEN;
  8736.           }
  8737.           else if (tTd(38, 4))
  8738. !             printf("%s:%s: invalid: %s\n",
  8739.                   map->map_class->map_cname == NULL ? "NULL" :
  8740.                       map->map_class->map_cname,
  8741.                   map->map_file == NULL ? "NULL" :
  8742. --- 404,410 ----
  8743.               map->map_mflags |= MF_OPEN;
  8744.           }
  8745.           else if (tTd(38, 4))
  8746. !             printf("\t%s:%s: invalid: %s\n",
  8747.                   map->map_class->map_cname == NULL ? "NULL" :
  8748.                       map->map_class->map_cname,
  8749.                   map->map_file == NULL ? "NULL" :
  8750. ***************
  8751. *** 434,442 ****
  8752.           return FALSE;
  8753.       }
  8754.       map->map_db1 = (void *) dbm;
  8755. !     if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags))
  8756. !         if (!aliaswait(map, ".pag", TRUE))
  8757.               return FALSE;
  8758.       if (fstat(dbm_dirfno((DBM *) map->map_db1), &st) >= 0)
  8759.           map->map_mtime = st.st_mtime;
  8760.       return TRUE;
  8761. --- 449,470 ----
  8762.           return FALSE;
  8763.       }
  8764.       map->map_db1 = (void *) dbm;
  8765. !     if (mode == O_RDONLY)
  8766. !     {
  8767. !         if (bitset(MF_ALIAS, map->map_mflags) &&
  8768. !             !aliaswait(map, ".pag", TRUE))
  8769.               return FALSE;
  8770. +     }
  8771. +     else
  8772. +     {
  8773. +         int fd;
  8774. +         /* exclusive lock for duration of rebuild */
  8775. +         fd = dbm_dirfno((DBM *) map->map_db1);
  8776. +         if (fd >= 0 && !bitset(MF_LOCKED, map->map_mflags) &&
  8777. +             lockfile(fd, map->map_file, ".dir", LOCK_EX))
  8778. +             map->map_mflags |= MF_LOCKED;
  8779. +     }
  8780.       if (fstat(dbm_dirfno((DBM *) map->map_db1), &st) >= 0)
  8781.           map->map_mtime = st.st_mtime;
  8782.       return TRUE;
  8783. ***************
  8784. *** 559,565 ****
  8785.           (void) sprintf(buf, "%010ld", curtime());
  8786.           ndbm_map_store(map, "YP_LAST_MODIFIED", buf);
  8787.   
  8788. !         (void) myhostname(buf, sizeof buf);
  8789.           ndbm_map_store(map, "YP_MASTER_NAME", buf);
  8790.   
  8791.           if (inclnull)
  8792. --- 587,593 ----
  8793.           (void) sprintf(buf, "%010ld", curtime());
  8794.           ndbm_map_store(map, "YP_LAST_MODIFIED", buf);
  8795.   
  8796. !         (void) gethostname(buf, sizeof buf);
  8797.           ndbm_map_store(map, "YP_MASTER_NAME", buf);
  8798.   
  8799.           if (inclnull)
  8800. ***************
  8801. *** 1237,1242 ****
  8802. --- 1265,1273 ----
  8803.   #if defined(NEWDB) || defined(NDBM)
  8804.       if (Verbose)
  8805.           message("WARNING: cannot open alias database %s", map->map_file);
  8806. + #else
  8807. +     if (mode != O_RDONLY)
  8808. +         usrerr("Cannot rebuild aliases: no database format defined");
  8809.   #endif
  8810.   
  8811.       return stab_map_open(map, mode);
  8812. *** src/mci.c.OLD    Sun Nov  7 15:01:11 1993
  8813. --- src/mci.c    Wed Dec  1 14:01:45 1993
  8814. ***************
  8815. *** 33,39 ****
  8816.    */
  8817.   
  8818.   #ifndef lint
  8819. ! static char sccsid[] = "@(#)mci.c    8.6 (Berkeley) 10/23/93";
  8820.   #endif /* not lint */
  8821.   
  8822.   #include "sendmail.h"
  8823. --- 33,39 ----
  8824.    */
  8825.   
  8826.   #ifndef lint
  8827. ! static char sccsid[] = "@(#)mci.c    8.9 (Berkeley) 12/1/93";
  8828.   #endif /* not lint */
  8829.   
  8830.   #include "sendmail.h"
  8831. ***************
  8832. *** 275,280 ****
  8833. --- 275,282 ----
  8834.       bzero(&CurHostAddr, sizeof CurHostAddr);
  8835.   #endif
  8836.   
  8837. +     if (m->m_mno < 0)
  8838. +         syserr("negative mno %d (%s)", m->m_mno, m->m_name);
  8839.       s = stab(host, ST_MCI + m->m_mno, ST_ENTER);
  8840.       mci = &s->s_mci;
  8841.       mci->mci_host = s->s_name;
  8842. ***************
  8843. *** 348,354 ****
  8844.           ctime(&mci->mci_lastuse));
  8845.   printit:
  8846.       if (logit)
  8847. !         syslog(LOG_INFO, "%s", buf);
  8848.       else
  8849.           printf("%s\n", buf);
  8850.   }
  8851. --- 350,356 ----
  8852.           ctime(&mci->mci_lastuse));
  8853.   printit:
  8854.       if (logit)
  8855. !         syslog(LOG_DEBUG, "%s", buf);
  8856.       else
  8857.           printf("%s\n", buf);
  8858.   }
  8859. ***************
  8860. *** 367,372 ****
  8861. --- 369,377 ----
  8862.       bool logit;
  8863.   {
  8864.       register int i;
  8865. +     if (MciCache == NULL)
  8866. +         return;
  8867.   
  8868.       for (i = 0; i < MaxMciCache; i++)
  8869.           mci_dump(MciCache[i], logit);
  8870. *** src/parseaddr.c.OLD    Sun Nov 14 10:30:10 1993
  8871. --- src/parseaddr.c    Wed Jan  5 09:20:14 1994
  8872. ***************
  8873. *** 33,39 ****
  8874.    */
  8875.   
  8876.   #ifndef lint
  8877. ! static char sccsid[] = "@(#)parseaddr.c    8.17 (Berkeley) 10/31/93";
  8878.   #endif /* not lint */
  8879.   
  8880.   # include "sendmail.h"
  8881. --- 33,39 ----
  8882.    */
  8883.   
  8884.   #ifndef lint
  8885. ! static char sccsid[] = "@(#)parseaddr.c    8.29 (Berkeley) 1/5/94";
  8886.   #endif /* not lint */
  8887.   
  8888.   # include "sendmail.h"
  8889. ***************
  8890. *** 103,109 ****
  8891.       if (delimptr == NULL)
  8892.           delimptr = &delimptrbuf;
  8893.   
  8894. !     pvp = prescan(addr, delim, pvpbuf, delimptr);
  8895.       if (pvp == NULL)
  8896.       {
  8897.           if (tTd(20, 1))
  8898. --- 103,109 ----
  8899.       if (delimptr == NULL)
  8900.           delimptr = &delimptrbuf;
  8901.   
  8902. !     pvp = prescan(addr, delim, pvpbuf, sizeof pvpbuf, delimptr);
  8903.       if (pvp == NULL)
  8904.       {
  8905.           if (tTd(20, 1))
  8906. ***************
  8907. *** 143,151 ****
  8908.       */
  8909.   
  8910.       queueup = FALSE;
  8911. !     if (rewrite(pvp, 3, e) == EX_TEMPFAIL)
  8912.           queueup = TRUE;
  8913. !     if (rewrite(pvp, 0, e) == EX_TEMPFAIL)
  8914.           queueup = TRUE;
  8915.   
  8916.   
  8917. --- 143,151 ----
  8918.       */
  8919.   
  8920.       queueup = FALSE;
  8921. !     if (rewrite(pvp, 3, 0, e) == EX_TEMPFAIL)
  8922.           queueup = TRUE;
  8923. !     if (rewrite(pvp, 0, 0, e) == EX_TEMPFAIL)
  8924.           queueup = TRUE;
  8925.   
  8926.   
  8927. ***************
  8928. *** 308,313 ****
  8929. --- 308,314 ----
  8930.   **            If '\t' then we are reading the .cf file.
  8931.   **        pvpbuf -- place to put the saved text -- note that
  8932.   **            the pointers are static.
  8933. + **        pvpbsize -- size of pvpbuf.
  8934.   **        delimptr -- if non-NULL, set to the location of the
  8935.   **            terminating delimiter.
  8936.   **
  8937. ***************
  8938. *** 341,350 ****
  8939.       /*ONE*/        OPR,    OPR,    OPR,    OPR,    OPR,
  8940.   };
  8941.   
  8942.   # define NOCHAR        -1    /* signal nothing in lookahead token */
  8943.   
  8944.   char **
  8945. ! prescan(addr, delim, pvpbuf, delimptr)
  8946.       char *addr;
  8947.       char delim;
  8948.       char pvpbuf[];
  8949. --- 342,375 ----
  8950.       /*ONE*/        OPR,    OPR,    OPR,    OPR,    OPR,
  8951.   };
  8952.   
  8953. + /* token type table -- it gets modified with $o characters */
  8954. + static TokTypeTab[256] =
  8955. + {
  8956. +     ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,SPC,SPC,SPC,SPC,SPC,ATM,ATM,
  8957. +     ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
  8958. +     SPC,ATM,QST,ATM,ATM,ATM,ATM,ATM,ATM,SPC,ATM,ATM,ATM,ATM,ATM,ATM,
  8959. +     ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
  8960. +     ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
  8961. +     ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
  8962. +     ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
  8963. +     ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
  8964. +     OPR,OPR,ONE,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,
  8965. +     OPR,OPR,OPR,ONE,ONE,ONE,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,
  8966. +     ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
  8967. +     ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
  8968. +     ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
  8969. +     ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
  8970. +     ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
  8971. +     ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
  8972. + };
  8973. + #define toktype(c)    ((int) TokTypeTab[(c) & 0xff])
  8974.   # define NOCHAR        -1    /* signal nothing in lookahead token */
  8975.   
  8976.   char **
  8977. ! prescan(addr, delim, pvpbuf, pvpbsize, delimptr)
  8978.       char *addr;
  8979.       char delim;
  8980.       char pvpbuf[];
  8981. ***************
  8982. *** 362,369 ****
  8983. --- 387,410 ----
  8984.       int newstate;
  8985.       char *saveto = CurEnv->e_to;
  8986.       static char *av[MAXATOM+1];
  8987. +     static char firsttime = TRUE;
  8988.       extern int errno;
  8989.   
  8990. +     if (firsttime)
  8991. +     {
  8992. +         /* initialize the token type table */
  8993. +         char obuf[50];
  8994. +         firsttime = FALSE;
  8995. +         expand("\201o", obuf, &obuf[sizeof obuf - sizeof DELIMCHARS], CurEnv);
  8996. +         strcat(obuf, DELIMCHARS);
  8997. +         for (p = obuf; *p != '\0'; p++)
  8998. +         {
  8999. +             if (TokTypeTab[*p & 0xff] == ATM)
  9000. +                 TokTypeTab[*p & 0xff] = OPR;
  9001. +         }
  9002. +     }
  9003.       /* make sure error messages don't have garbage on them */
  9004.       errno = 0;
  9005.   
  9006. ***************
  9007. *** 393,401 ****
  9008.               if (c != NOCHAR && !bslashmode)
  9009.               {
  9010.                   /* see if there is room */
  9011. !                 if (q >= &pvpbuf[PSBUFSIZE - 5])
  9012.                   {
  9013.                       usrerr("553 Address too long");
  9014.                       if (delimptr != NULL)
  9015.                           *delimptr = p;
  9016.                       CurEnv->e_to = saveto;
  9017. --- 434,443 ----
  9018.               if (c != NOCHAR && !bslashmode)
  9019.               {
  9020.                   /* see if there is room */
  9021. !                 if (q >= &pvpbuf[pvpbsize - 5])
  9022.                   {
  9023.                       usrerr("553 Address too long");
  9024. +     returnnull:
  9025.                       if (delimptr != NULL)
  9026.                           *delimptr = p;
  9027.                       CurEnv->e_to = saveto;
  9028. ***************
  9029. *** 527,537 ****
  9030.               if (avp >= &av[MAXATOM])
  9031.               {
  9032.                   syserr("553 prescan: too many tokens");
  9033. !                 if (delimptr != NULL)
  9034. !                     *delimptr = p;
  9035. !                 CurEnv->e_to = saveto;
  9036. !                 return (NULL);
  9037.               }
  9038.               *avp++ = tok;
  9039.           }
  9040.       } while (c != '\0' && (c != delim || anglecnt > 0));
  9041. --- 569,581 ----
  9042.               if (avp >= &av[MAXATOM])
  9043.               {
  9044.                   syserr("553 prescan: too many tokens");
  9045. !                 goto returnnull;
  9046.               }
  9047. +             if (q - tok > MAXNAME)
  9048. +             {
  9049. +                 syserr("553 prescan: token too long");
  9050. +                 goto returnnull;
  9051. +             }
  9052.               *avp++ = tok;
  9053.           }
  9054.       } while (c != '\0' && (c != delim || anglecnt > 0));
  9055. ***************
  9056. *** 546,597 ****
  9057.       }
  9058.       CurEnv->e_to = saveto;
  9059.       if (av[0] == NULL)
  9060.           return (NULL);
  9061.       return (av);
  9062.   }
  9063.    /*
  9064. - **  TOKTYPE -- return token type
  9065. - **
  9066. - **    Parameters:
  9067. - **        c -- the character in question.
  9068. - **
  9069. - **    Returns:
  9070. - **        Its type.
  9071. - **
  9072. - **    Side Effects:
  9073. - **        none.
  9074. - */
  9075. - toktype(c)
  9076. -     register int c;
  9077. - {
  9078. -     static char buf[50];
  9079. -     static bool firstime = TRUE;
  9080. -     if (firstime)
  9081. -     {
  9082. -         firstime = FALSE;
  9083. -         expand("\201o", buf, &buf[sizeof buf - 1], CurEnv);
  9084. -         (void) strcat(buf, DELIMCHARS);
  9085. -     }
  9086. -     c &= 0377;
  9087. -     if (c == MATCHCLASS || c == MATCHREPL || c == MATCHNCLASS)
  9088. -         return (ONE);
  9089. -     if (c == MACRODEXPAND)
  9090. -         return (ONE);
  9091. -     if (c == '"')
  9092. -         return (QST);
  9093. -     if ((c & 0340) == 0200)
  9094. -         return (OPR);
  9095. -     if (!isascii(c))
  9096. -         return (ATM);
  9097. -     if (isspace(c) || c == ')')
  9098. -         return (SPC);
  9099. -     if (strchr(buf, c) != NULL)
  9100. -         return (OPR);
  9101. -     return (ATM);
  9102. - }
  9103. -  /*
  9104.   **  REWRITE -- apply rewrite rules to token vector.
  9105.   **
  9106.   **    This routine is an ordered production system.  Each rewrite
  9107. --- 590,603 ----
  9108.       }
  9109.       CurEnv->e_to = saveto;
  9110.       if (av[0] == NULL)
  9111. +     {
  9112. +         if (tTd(22, 1))
  9113. +             printf("prescan: null leading token\n");
  9114.           return (NULL);
  9115. +     }
  9116.       return (av);
  9117.   }
  9118.    /*
  9119.   **  REWRITE -- apply rewrite rules to token vector.
  9120.   **
  9121.   **    This routine is an ordered production system.  Each rewrite
  9122. ***************
  9123. *** 616,621 ****
  9124. --- 622,628 ----
  9125.   **    Parameters:
  9126.   **        pvp -- pointer to token vector.
  9127.   **        ruleset -- the ruleset to use for rewriting.
  9128. + **        reclevel -- recursion level (to catch loops).
  9129.   **        e -- the current envelope.
  9130.   **
  9131.   **    Returns:
  9132. ***************
  9133. *** 635,645 ****
  9134.   
  9135.   # define MAXMATCH    9    /* max params per rewrite */
  9136.   
  9137.   
  9138.   int
  9139. ! rewrite(pvp, ruleset, e)
  9140.       char **pvp;
  9141.       int ruleset;
  9142.       register ENVELOPE *e;
  9143.   {
  9144.       register char *ap;        /* address pointer */
  9145. --- 642,657 ----
  9146.   
  9147.   # define MAXMATCH    9    /* max params per rewrite */
  9148.   
  9149. + # ifndef MAXRULERECURSION
  9150. + #  define MAXRULERECURSION    50    /* max recursion depth */
  9151. + # endif
  9152.   
  9153.   int
  9154. ! rewrite(pvp, ruleset, reclevel, e)
  9155.       char **pvp;
  9156.       int ruleset;
  9157. +     int reclevel;
  9158.       register ENVELOPE *e;
  9159.   {
  9160.       register char *ap;        /* address pointer */
  9161. ***************
  9162. *** 664,669 ****
  9163. --- 676,686 ----
  9164.           syserr("554 rewrite: illegal ruleset number %d", ruleset);
  9165.           return EX_CONFIG;
  9166.       }
  9167. +     if (reclevel++ > MAXRULERECURSION)
  9168. +     {
  9169. +         syserr("rewrite: infinite recursion, ruleset %d", ruleset);
  9170. +         return EX_CONFIG;
  9171. +     }
  9172.       if (pvp == NULL)
  9173.           return EX_USAGE;
  9174.   
  9175. ***************
  9176. *** 1124,1130 ****
  9177.               else
  9178.               {
  9179.                   /* scan the new replacement */
  9180. !                 xpvp = prescan(replac, '\0', pvpbuf, NULL);
  9181.                   if (xpvp == NULL)
  9182.                   {
  9183.                       /* prescan already printed error */
  9184. --- 1141,1148 ----
  9185.               else
  9186.               {
  9187.                   /* scan the new replacement */
  9188. !                 xpvp = prescan(replac, '\0', pvpbuf,
  9189. !                            sizeof pvpbuf, NULL);
  9190.                   if (xpvp == NULL)
  9191.                   {
  9192.                       /* prescan already printed error */
  9193. ***************
  9194. *** 1156,1170 ****
  9195.           {
  9196.               int stat;
  9197.   
  9198. !             bcopy((char *) &npvp[2], (char *) pvp,
  9199. !                 (int) (avp - npvp - 2) * sizeof *avp);
  9200. !             if (tTd(21, 3))
  9201. !                 printf("-----callsubr %s\n", npvp[1]);
  9202. !             stat = rewrite(pvp, atoi(npvp[1]), e);
  9203. !             if (rstat == EX_OK || stat == EX_TEMPFAIL)
  9204. !                 rstat = stat;
  9205. !             if ((**pvp & 0377) == CANONNET)
  9206.                   rwr = NULL;
  9207.           }
  9208.           else
  9209.           {
  9210. --- 1174,1197 ----
  9211.           {
  9212.               int stat;
  9213.   
  9214. !             if (npvp[1] == NULL)
  9215. !             {
  9216. !                 syserr("parseaddr: NULL subroutine call in ruleset %d, rule %d",
  9217. !                     ruleset, ruleno);
  9218. !                 *pvp = NULL;
  9219. !             }
  9220. !             else
  9221. !             {
  9222. !                 bcopy((char *) &npvp[2], (char *) pvp,
  9223. !                     (int) (avp - npvp - 2) * sizeof *avp);
  9224. !                 if (tTd(21, 3))
  9225. !                     printf("-----callsubr %s\n", npvp[1]);
  9226. !                 stat = rewrite(pvp, atoi(npvp[1]), reclevel, e);
  9227. !                 if (rstat == EX_OK || stat == EX_TEMPFAIL)
  9228. !                     rstat = stat;
  9229. !                 if (*pvp != NULL && (**pvp & 0377) == CANONNET)
  9230.                   rwr = NULL;
  9231. +             }
  9232.           }
  9233.           else
  9234.           {
  9235. ***************
  9236. *** 1285,1290 ****
  9237. --- 1312,1319 ----
  9238.               }
  9239.               tv++;
  9240.           }
  9241. +         else
  9242. +             setstat(EX_UNAVAILABLE);
  9243.           if ((**tv & 0377) != CANONUSER)
  9244.               syserr("554 buildaddr: error: no user");
  9245.           cataddr(++tv, NULL, buf, sizeof buf, ' ');
  9246. ***************
  9247. *** 1402,1412 ****
  9248.       if (!bitset(RF_SENDERADDR|RF_HEADERADDR, flags))
  9249.       {
  9250.           /* sender addresses done later */
  9251. !         (void) rewrite(tv, 2, e);
  9252.           if (m->m_re_rwset > 0)
  9253. !                (void) rewrite(tv, m->m_re_rwset, e);
  9254.       }
  9255. !     (void) rewrite(tv, 4, e);
  9256.   
  9257.       /* save the result for the command line/RCPT argument */
  9258.       cataddr(tv, NULL, buf, sizeof buf, '\0');
  9259. --- 1431,1441 ----
  9260.       if (!bitset(RF_SENDERADDR|RF_HEADERADDR, flags))
  9261.       {
  9262.           /* sender addresses done later */
  9263. !         (void) rewrite(tv, 2, 0, e);
  9264.           if (m->m_re_rwset > 0)
  9265. !                (void) rewrite(tv, m->m_re_rwset, 0, e);
  9266.       }
  9267. !     (void) rewrite(tv, 4, 0, e);
  9268.   
  9269.       /* save the result for the command line/RCPT argument */
  9270.       cataddr(tv, NULL, buf, sizeof buf, '\0');
  9271. ***************
  9272. *** 1500,1505 ****
  9273. --- 1529,1536 ----
  9274.       register ADDRESS *a;
  9275.       register ADDRESS *b;
  9276.   {
  9277. +     register ADDRESS *ca, *cb;
  9278.       /* if they don't have the same mailer, forget it */
  9279.       if (a->q_mailer != b->q_mailer)
  9280.           return (FALSE);
  9281. ***************
  9282. *** 1508,1516 ****
  9283.       if (strcmp(a->q_user, b->q_user) != 0)
  9284.           return (FALSE);
  9285.   
  9286. !     /* if we have good uids for both but the differ, these are different */
  9287. !     if (bitset(QGOODUID, a->q_flags & b->q_flags) && a->q_uid != b->q_uid)
  9288. !         return (FALSE);
  9289.   
  9290.       /* otherwise compare hosts (but be careful for NULL ptrs) */
  9291.       if (a->q_host == b->q_host)
  9292. --- 1539,1554 ----
  9293.       if (strcmp(a->q_user, b->q_user) != 0)
  9294.           return (FALSE);
  9295.   
  9296. !     /* if we have good uids for both but they differ, these are different */
  9297. !     if (a->q_mailer == ProgMailer)
  9298. !     {
  9299. !         ca = getctladdr(a);
  9300. !         cb = getctladdr(b);
  9301. !         if (ca != NULL && cb != NULL &&
  9302. !             bitset(QGOODUID, ca->q_flags & cb->q_flags) &&
  9303. !             ca->q_uid != cb->q_uid)
  9304. !             return (FALSE);
  9305. !     }
  9306.   
  9307.       /* otherwise compare hosts (but be careful for NULL ptrs) */
  9308.       if (a->q_host == b->q_host)
  9309. ***************
  9310. *** 1655,1664 ****
  9311.       **    domain will be appended.
  9312.       */
  9313.   
  9314. !     pvp = prescan(name, '\0', pvpbuf, NULL);
  9315.       if (pvp == NULL)
  9316.           return (name);
  9317. !     if (rewrite(pvp, 3, e) == EX_TEMPFAIL)
  9318.           *pstat = EX_TEMPFAIL;
  9319.       if (bitset(RF_ADDDOMAIN, flags) && e->e_fromdomain != NULL)
  9320.       {
  9321. --- 1693,1702 ----
  9322.       **    domain will be appended.
  9323.       */
  9324.   
  9325. !     pvp = prescan(name, '\0', pvpbuf, sizeof pvpbuf, NULL);
  9326.       if (pvp == NULL)
  9327.           return (name);
  9328. !     if (rewrite(pvp, 3, 0, e) == EX_TEMPFAIL)
  9329.           *pstat = EX_TEMPFAIL;
  9330.       if (bitset(RF_ADDDOMAIN, flags) && e->e_fromdomain != NULL)
  9331.       {
  9332. ***************
  9333. *** 1675,1681 ****
  9334.   
  9335.               while ((*pxp++ = *qxq++) != NULL)
  9336.                   continue;
  9337. !             if (rewrite(pvp, 3, e) == EX_TEMPFAIL)
  9338.                   *pstat = EX_TEMPFAIL;
  9339.           }
  9340.       }
  9341. --- 1713,1719 ----
  9342.   
  9343.               while ((*pxp++ = *qxq++) != NULL)
  9344.                   continue;
  9345. !             if (rewrite(pvp, 3, 0, e) == EX_TEMPFAIL)
  9346.                   *pstat = EX_TEMPFAIL;
  9347.           }
  9348.       }
  9349. ***************
  9350. *** 1689,1705 ****
  9351.   
  9352.       if (bitset(RF_SENDERADDR, flags))
  9353.       {
  9354. !         if (rewrite(pvp, 1, e) == EX_TEMPFAIL)
  9355.               *pstat = EX_TEMPFAIL;
  9356.       }
  9357.       else
  9358.       {
  9359. !         if (rewrite(pvp, 2, e) == EX_TEMPFAIL)
  9360.               *pstat = EX_TEMPFAIL;
  9361.       }
  9362.       if (rwset > 0)
  9363.       {
  9364. !         if (rewrite(pvp, rwset, e) == EX_TEMPFAIL)
  9365.               *pstat = EX_TEMPFAIL;
  9366.       }
  9367.   
  9368. --- 1727,1743 ----
  9369.   
  9370.       if (bitset(RF_SENDERADDR, flags))
  9371.       {
  9372. !         if (rewrite(pvp, 1, 0, e) == EX_TEMPFAIL)
  9373.               *pstat = EX_TEMPFAIL;
  9374.       }
  9375.       else
  9376.       {
  9377. !         if (rewrite(pvp, 2, 0, e) == EX_TEMPFAIL)
  9378.               *pstat = EX_TEMPFAIL;
  9379.       }
  9380.       if (rwset > 0)
  9381.       {
  9382. !         if (rewrite(pvp, rwset, 0, e) == EX_TEMPFAIL)
  9383.               *pstat = EX_TEMPFAIL;
  9384.       }
  9385.   
  9386. ***************
  9387. *** 1710,1716 ****
  9388.       **    may be used as a default to the above rules.
  9389.       */
  9390.   
  9391. !     if (rewrite(pvp, 4, e) == EX_TEMPFAIL)
  9392.           *pstat = EX_TEMPFAIL;
  9393.   
  9394.       /*
  9395. --- 1748,1754 ----
  9396.       **    may be used as a default to the above rules.
  9397.       */
  9398.   
  9399. !     if (rewrite(pvp, 4, 0, e) == EX_TEMPFAIL)
  9400.           *pstat = EX_TEMPFAIL;
  9401.   
  9402.       /*
  9403. ***************
  9404. *** 1719,1725 ****
  9405.   
  9406.       cataddr(pvp, NULL, lbuf, sizeof lbuf, '\0');
  9407.       define('g', lbuf, e);
  9408. !     expand(fancy, buf, &buf[sizeof buf - 1], e);
  9409.       define('g', oldg, e);
  9410.   
  9411.       if (tTd(12, 1))
  9412. --- 1757,1769 ----
  9413.   
  9414.       cataddr(pvp, NULL, lbuf, sizeof lbuf, '\0');
  9415.       define('g', lbuf, e);
  9416. !     /* need to make sure route-addrs have <angle brackets> */
  9417. !     if (bitset(RF_CANONICAL, flags) && lbuf[0] == '@')
  9418. !         expand("<\201g>", buf, &buf[sizeof buf - 1], e);
  9419. !     else
  9420. !         expand(fancy, buf, &buf[sizeof buf - 1], e);
  9421.       define('g', oldg, e);
  9422.   
  9423.       if (tTd(12, 1))
  9424. ***************
  9425. *** 1753,1763 ****
  9426.           printf("maplocaluser: ");
  9427.           printaddr(a, FALSE);
  9428.       }
  9429. !     pvp = prescan(a->q_user, '\0', pvpbuf, &delimptr);
  9430.       if (pvp == NULL)
  9431.           return;
  9432.   
  9433. !     (void) rewrite(pvp, 5, e);
  9434.       if (pvp[0] == NULL || (pvp[0][0] & 0377) != CANONNET)
  9435.           return;
  9436.   
  9437. --- 1797,1807 ----
  9438.           printf("maplocaluser: ");
  9439.           printaddr(a, FALSE);
  9440.       }
  9441. !     pvp = prescan(a->q_user, '\0', pvpbuf, sizeof pvpbuf, &delimptr);
  9442.       if (pvp == NULL)
  9443.           return;
  9444.   
  9445. !     (void) rewrite(pvp, 5, 0, e);
  9446.       if (pvp[0] == NULL || (pvp[0][0] & 0377) != CANONNET)
  9447.           return;
  9448.   
  9449. *** src/queue.c.OLD    Thu Nov 11 17:58:27 1993
  9450. --- src/queue.c    Sun Jan  9 09:22:40 1994
  9451. ***************
  9452. *** 36,44 ****
  9453.   
  9454.   #ifndef lint
  9455.   #ifdef QUEUE
  9456. ! static char sccsid[] = "@(#)queue.c    8.27 (Berkeley) 10/29/93 (with queueing)";
  9457.   #else
  9458. ! static char sccsid[] = "@(#)queue.c    8.27 (Berkeley) 10/29/93 (without queueing)";
  9459.   #endif
  9460.   #endif /* not lint */
  9461.   
  9462. --- 36,44 ----
  9463.   
  9464.   #ifndef lint
  9465.   #ifdef QUEUE
  9466. ! static char sccsid[] = "@(#)queue.c    8.36 (Berkeley) 1/9/94 (with queueing)";
  9467.   #else
  9468. ! static char sccsid[] = "@(#)queue.c    8.36 (Berkeley) 1/9/94 (without queueing)";
  9469.   #endif
  9470.   #endif /* not lint */
  9471.   
  9472. ***************
  9473. *** 121,142 ****
  9474.                       break;
  9475.   #ifdef LOG
  9476.                   if (LogLevel > 0 && (i % 32) == 0)
  9477. !                     syslog(LOG_ALERT, "queueup: cannot create %s: %s",
  9478. !                         tf, errstring(errno));
  9479.   #endif
  9480. -                 continue;
  9481.               }
  9482. !             if (lockfile(fd, tf, NULL, LOCK_EX|LOCK_NB))
  9483. !                 break;
  9484.   #ifdef LOG
  9485. !             else if (LogLevel > 0 && (i % 32) == 0)
  9486. !                 syslog(LOG_ALERT, "queueup: cannot lock %s: %s",
  9487. !                     tf, errstring(errno));
  9488.   #endif
  9489.   
  9490. -             close(fd);
  9491.               if ((i % 32) == 31)
  9492.               {
  9493.                   /* save the old temp file away */
  9494. --- 121,142 ----
  9495.                       break;
  9496.   #ifdef LOG
  9497.                   if (LogLevel > 0 && (i % 32) == 0)
  9498. !                     syslog(LOG_ALERT, "queueup: cannot create %s, uid=%d: %s",
  9499. !                         tf, geteuid(), errstring(errno));
  9500.   #endif
  9501.               }
  9502. !             else
  9503. !             {
  9504. !                 if (lockfile(fd, tf, NULL, LOCK_EX|LOCK_NB))
  9505. !                     break;
  9506.   #ifdef LOG
  9507. !                 else if (LogLevel > 0 && (i % 32) == 0)
  9508. !                     syslog(LOG_ALERT, "queueup: cannot lock %s: %s",
  9509. !                         tf, errstring(errno));
  9510.   #endif
  9511. +                 close(fd);
  9512. +             }
  9513.   
  9514.               if ((i % 32) == 31)
  9515.               {
  9516.                   /* save the old temp file away */
  9517. ***************
  9518. *** 146,152 ****
  9519.                   sleep(i % 32);
  9520.           }
  9521.           if (fd < 0 || (tfp = fdopen(fd, "w")) == NULL)
  9522. !             syserr("!queueup: cannot create queue temp file %s", tf);
  9523.       }
  9524.   
  9525.       if (tTd(40, 1))
  9526. --- 146,156 ----
  9527.                   sleep(i % 32);
  9528.           }
  9529.           if (fd < 0 || (tfp = fdopen(fd, "w")) == NULL)
  9530. !         {
  9531. !             printopenfds(TRUE);
  9532. !             syserr("!queueup: cannot create queue temp file %s, uid=%d",
  9533. !                 tf, geteuid());
  9534. !         }
  9535.       }
  9536.   
  9537.       if (tTd(40, 1))
  9538. ***************
  9539. *** 176,183 ****
  9540.           e->e_df = newstr(e->e_df);
  9541.           fd = open(e->e_df, O_WRONLY|O_CREAT, FileMode);
  9542.           if (fd < 0 || (dfp = fdopen(fd, "w")) == NULL)
  9543. !             syserr("!queueup: cannot create data temp file %s",
  9544. !                 e->e_df);
  9545.           (*e->e_putbody)(dfp, FileMailer, e, NULL);
  9546.           (void) xfclose(dfp, "queueup dfp", e->e_id);
  9547.           e->e_putbody = putbody;
  9548. --- 180,187 ----
  9549.           e->e_df = newstr(e->e_df);
  9550.           fd = open(e->e_df, O_WRONLY|O_CREAT, FileMode);
  9551.           if (fd < 0 || (dfp = fdopen(fd, "w")) == NULL)
  9552. !             syserr("!queueup: cannot create data temp file %s, uid=%d",
  9553. !                 e->e_df, geteuid());
  9554.           (*e->e_putbody)(dfp, FileMailer, e, NULL);
  9555.           (void) xfclose(dfp, "queueup dfp", e->e_id);
  9556.           e->e_putbody = putbody;
  9557. ***************
  9558. *** 272,278 ****
  9559.   
  9560.       bzero((char *) &nullmailer, sizeof nullmailer);
  9561.       nullmailer.m_re_rwset = nullmailer.m_rh_rwset =
  9562. !             nullmailer.m_se_rwset = nullmailer.m_sh_rwset = 0;
  9563.       nullmailer.m_eol = "\n";
  9564.   
  9565.       define('g', "\201f", e);
  9566. --- 276,282 ----
  9567.   
  9568.       bzero((char *) &nullmailer, sizeof nullmailer);
  9569.       nullmailer.m_re_rwset = nullmailer.m_rh_rwset =
  9570. !             nullmailer.m_se_rwset = nullmailer.m_sh_rwset = -1;
  9571.       nullmailer.m_eol = "\n";
  9572.   
  9573.       define('g', "\201f", e);
  9574. ***************
  9575. *** 288,293 ****
  9576. --- 292,305 ----
  9577.           if (bitset(H_RESENT, h->h_flags) && !bitset(EF_RESENT, e->e_flags))
  9578.               continue;
  9579.   
  9580. +         /* expand macros; if null, don't output header at all */
  9581. +         if (bitset(H_DEFAULT, h->h_flags))
  9582. +         {
  9583. +             (void) expand(h->h_value, buf, &buf[sizeof buf], e);
  9584. +             if (buf[0] == '\0')
  9585. +                 continue;
  9586. +         }
  9587.           /* output this header */
  9588.           fprintf(tfp, "H");
  9589.   
  9590. ***************
  9591. *** 306,312 ****
  9592.           /* output the header: expand macros, convert addresses */
  9593.           if (bitset(H_DEFAULT, h->h_flags))
  9594.           {
  9595. -             (void) expand(h->h_value, buf, &buf[sizeof buf], e);
  9596.               fprintf(tfp, "%s: %s\n", h->h_field, buf);
  9597.           }
  9598.           else if (bitset(H_FROM|H_RCPT, h->h_flags))
  9599. --- 318,323 ----
  9600. ***************
  9601. *** 345,351 ****
  9602.           /* rename (locked) tf to be (locked) qf */
  9603.           qf = queuename(e, 'q');
  9604.           if (rename(tf, qf) < 0)
  9605. !             syserr("cannot rename(%s, %s), df=%s", tf, qf, e->e_df);
  9606.   
  9607.           /* close and unlock old (locked) qf */
  9608.           if (e->e_lockfp != NULL)
  9609. --- 356,363 ----
  9610.           /* rename (locked) tf to be (locked) qf */
  9611.           qf = queuename(e, 'q');
  9612.           if (rename(tf, qf) < 0)
  9613. !             syserr("cannot rename(%s, %s), df=%s, uid=%d",
  9614. !                 tf, qf, e->e_df, geteuid());
  9615.   
  9616.           /* close and unlock old (locked) qf */
  9617.           if (e->e_lockfp != NULL)
  9618. ***************
  9619. *** 461,477 ****
  9620.       if (forkflag)
  9621.       {
  9622.           int pid;
  9623.   
  9624.           pid = dofork();
  9625.           if (pid != 0)
  9626.           {
  9627. -             extern void reapchild();
  9628.               /* parent -- pick up intermediate zombie */
  9629.   #ifndef SIGCHLD
  9630.               (void) waitfor(pid);
  9631. - #else /* SIGCHLD */
  9632. -             (void) setsignal(SIGCHLD, reapchild);
  9633.   #endif /* SIGCHLD */
  9634.               if (QueueIntvl != 0)
  9635.                   (void) setevent(QueueIntvl, runqueue, TRUE);
  9636. --- 473,490 ----
  9637.       if (forkflag)
  9638.       {
  9639.           int pid;
  9640. + #ifdef SIGCHLD
  9641. +         extern void reapchild();
  9642.   
  9643. +         (void) setsignal(SIGCHLD, reapchild);
  9644. + #endif
  9645.           pid = dofork();
  9646.           if (pid != 0)
  9647.           {
  9648.               /* parent -- pick up intermediate zombie */
  9649.   #ifndef SIGCHLD
  9650.               (void) waitfor(pid);
  9651.   #endif /* SIGCHLD */
  9652.               if (QueueIntvl != 0)
  9653.                   (void) setevent(QueueIntvl, runqueue, TRUE);
  9654. ***************
  9655. *** 850,855 ****
  9656. --- 863,873 ----
  9657.               syserr("dowork: cannot fork");
  9658.               return 0;
  9659.           }
  9660. +         else if (pid > 0)
  9661. +         {
  9662. +             /* parent -- clean out connection cache */
  9663. +             mci_flush(FALSE, NULL);
  9664. +         }
  9665.       }
  9666.       else
  9667.       {
  9668. ***************
  9669. *** 888,894 ****
  9670.           e->e_header = NULL;
  9671.   
  9672.           /* read the queue control file -- return if locked */
  9673. !         if (!readqf(e, !requeueflag))
  9674.           {
  9675.               if (tTd(40, 4))
  9676.                   printf("readqf(%s) failed\n", e->e_id);
  9677. --- 906,912 ----
  9678.           e->e_header = NULL;
  9679.   
  9680.           /* read the queue control file -- return if locked */
  9681. !         if (!readqf(e))
  9682.           {
  9683.               if (tTd(40, 4))
  9684.                   printf("readqf(%s) failed\n", e->e_id);
  9685. ***************
  9686. *** 921,928 ****
  9687.   **
  9688.   **    Parameters:
  9689.   **        e -- the envelope of the job to run.
  9690. - **        announcefile -- if set, announce the name of the queue
  9691. - **            file in error messages.
  9692.   **
  9693.   **    Returns:
  9694.   **        TRUE if it successfully read the queue file.
  9695. --- 939,944 ----
  9696. ***************
  9697. *** 933,941 ****
  9698.   */
  9699.   
  9700.   bool
  9701. ! readqf(e, announcefile)
  9702.       register ENVELOPE *e;
  9703. -     bool announcefile;
  9704.   {
  9705.       register FILE *qfp;
  9706.       ADDRESS *ctladdr;
  9707. --- 949,956 ----
  9708.   */
  9709.   
  9710.   bool
  9711. ! readqf(e)
  9712.       register ENVELOPE *e;
  9713.   {
  9714.       register FILE *qfp;
  9715.       ADDRESS *ctladdr;
  9716. ***************
  9717. *** 1031,1039 ****
  9718.   
  9719.       /* do basic system initialization */
  9720.       initsys(e);
  9721.   
  9722. -     if (announcefile)
  9723. -         FileName = qf;
  9724.       LineNumber = 0;
  9725.       e->e_flags |= EF_GLOBALERRS;
  9726.       OpMode = MD_DELIVER;
  9727. --- 1046,1053 ----
  9728.   
  9729.       /* do basic system initialization */
  9730.       initsys(e);
  9731. +     define('i', e->e_id, e);
  9732.   
  9733.       LineNumber = 0;
  9734.       e->e_flags |= EF_GLOBALERRS;
  9735.       OpMode = MD_DELIVER;
  9736. ***************
  9737. *** 1121,1128 ****
  9738.               break;
  9739.   
  9740.             default:
  9741. !             syserr("readqf: bad line \"%s\"", e->e_id,
  9742. !                 LineNumber, bp);
  9743.               fclose(qfp);
  9744.               rename(qf, queuename(e, 'Q'));
  9745.               return FALSE;
  9746. --- 1135,1142 ----
  9747.               break;
  9748.   
  9749.             default:
  9750. !             syserr("readqf: %s: line %s: bad line \"%s\"",
  9751. !                 qf, LineNumber, bp);
  9752.               fclose(qfp);
  9753.               rename(qf, queuename(e, 'Q'));
  9754.               return FALSE;
  9755. ***************
  9756. *** 1131,1138 ****
  9757.           if (bp != buf)
  9758.               free(bp);
  9759.       }
  9760. -     FileName = NULL;
  9761.   
  9762.       /*
  9763.       **  If we haven't read any lines, this queue file is empty.
  9764. --- 1145,1150 ----
  9765. *** src/readcf.c.OLD    Sun Nov 14 10:16:20 1993
  9766. --- src/readcf.c    Sun Jan  9 09:00:09 1994
  9767. ***************
  9768. *** 33,39 ****
  9769.    */
  9770.   
  9771.   #ifndef lint
  9772. ! static char sccsid[] = "@(#)readcf.c    8.14 (Berkeley) 10/31/93";
  9773.   #endif /* not lint */
  9774.   
  9775.   # include "sendmail.h"
  9776. --- 33,39 ----
  9777.    */
  9778.   
  9779.   #ifndef lint
  9780. ! static char sccsid[] = "@(#)readcf.c    8.18 (Berkeley) 1/9/94";
  9781.   #endif /* not lint */
  9782.   
  9783.   # include "sendmail.h"
  9784. ***************
  9785. *** 109,115 ****
  9786.       extern char **copyplist();
  9787.       struct stat statb;
  9788.       char exbuf[MAXLINE];
  9789. !     char pvpbuf[PSBUFSIZE];
  9790.       extern char *munchstring();
  9791.       extern void makemapentry();
  9792.   
  9793. --- 109,115 ----
  9794.       extern char **copyplist();
  9795.       struct stat statb;
  9796.       char exbuf[MAXLINE];
  9797. !     char pvpbuf[MAXLINE + MAXATOM];
  9798.       extern char *munchstring();
  9799.       extern void makemapentry();
  9800.   
  9801. ***************
  9802. *** 241,247 ****
  9803.               /* expand and save the LHS */
  9804.               *p = '\0';
  9805.               expand(&bp[1], exbuf, &exbuf[sizeof exbuf], e);
  9806. !             rwp->r_lhs = prescan(exbuf, '\t', pvpbuf, NULL);
  9807.               nfuzzy = 0;
  9808.               if (rwp->r_lhs != NULL)
  9809.               {
  9810. --- 241,248 ----
  9811.               /* expand and save the LHS */
  9812.               *p = '\0';
  9813.               expand(&bp[1], exbuf, &exbuf[sizeof exbuf], e);
  9814. !             rwp->r_lhs = prescan(exbuf, '\t', pvpbuf,
  9815. !                          sizeof pvpbuf, NULL);
  9816.               nfuzzy = 0;
  9817.               if (rwp->r_lhs != NULL)
  9818.               {
  9819. ***************
  9820. *** 325,331 ****
  9821.                   p++;
  9822.               *p = '\0';
  9823.               expand(q, exbuf, &exbuf[sizeof exbuf], e);
  9824. !             rwp->r_rhs = prescan(exbuf, '\t', pvpbuf, NULL);
  9825.               if (rwp->r_rhs != NULL)
  9826.               {
  9827.                   register char **ap;
  9828. --- 326,333 ----
  9829.                   p++;
  9830.               *p = '\0';
  9831.               expand(q, exbuf, &exbuf[sizeof exbuf], e);
  9832. !             rwp->r_rhs = prescan(exbuf, '\t', pvpbuf,
  9833. !                          sizeof pvpbuf, NULL);
  9834.               if (rwp->r_rhs != NULL)
  9835.               {
  9836.                   register char **ap;
  9837. ***************
  9838. *** 540,547 ****
  9839. --- 542,551 ----
  9840.       {
  9841.           /* user didn't initialize: set up host map */
  9842.           strcpy(buf, "host host");
  9843. + #ifdef NAMED_BIND
  9844.           if (ConfigLevel >= 2)
  9845.               strcat(buf, " -a.");
  9846. + #endif
  9847.           makemapentry(buf);
  9848.       }
  9849.   }
  9850. ***************
  9851. *** 1020,1025 ****
  9852. --- 1024,1030 ----
  9853.       "defnames",    RES_DEFNAMES,
  9854.       "stayopen",    RES_STAYOPEN,
  9855.       "dnsrch",    RES_DNSRCH,
  9856. +     "true",        0,        /* to avoid error on old syntax */
  9857.       NULL,        0
  9858.   };
  9859.   
  9860. ***************
  9861. *** 1239,1245 ****
  9862.                   if (strcasecmp(q, rfp->rf_name) == 0)
  9863.                       break;
  9864.               }
  9865. !             if (clearmode)
  9866.                   _res.options &= ~rfp->rf_bits;
  9867.               else
  9868.                   _res.options |= rfp->rf_bits;
  9869. --- 1244,1252 ----
  9870.                   if (strcasecmp(q, rfp->rf_name) == 0)
  9871.                       break;
  9872.               }
  9873. !             if (rfp->rf_name == NULL)
  9874. !                 syserr("readcf: I option value %s unrecognized", q);
  9875. !             else if (clearmode)
  9876.                   _res.options &= ~rfp->rf_bits;
  9877.               else
  9878.                   _res.options |= rfp->rf_bits;
  9879. *** src/recipient.c.OLD    Thu Nov  4 06:57:11 1993
  9880. --- src/recipient.c    Mon Jan 10 08:57:26 1994
  9881. ***************
  9882. *** 33,39 ****
  9883.    */
  9884.   
  9885.   #ifndef lint
  9886. ! static char sccsid[] = "@(#)recipient.c    8.21 (Berkeley) 10/29/93";
  9887.   #endif /* not lint */
  9888.   
  9889.   # include "sendmail.h"
  9890. --- 33,39 ----
  9891.    */
  9892.   
  9893.   #ifndef lint
  9894. ! static char sccsid[] = "@(#)recipient.c    8.39 (Berkeley) 1/10/94";
  9895.   #endif /* not lint */
  9896.   
  9897.   # include "sendmail.h"
  9898. ***************
  9899. *** 222,231 ****
  9900.       stripquotes(buf);
  9901.   
  9902.       /* check for direct mailing to restricted mailers */
  9903. !     if (a->q_alias == NULL && m == ProgMailer)
  9904.       {
  9905. !         a->q_flags |= QBADADDR;
  9906. !         usrerr("550 Cannot mail directly to programs");
  9907.       }
  9908.   
  9909.       /*
  9910. --- 222,246 ----
  9911.       stripquotes(buf);
  9912.   
  9913.       /* check for direct mailing to restricted mailers */
  9914. !     if (m == ProgMailer)
  9915.       {
  9916. !         if (a->q_alias == NULL)
  9917. !         {
  9918. !             a->q_flags |= QBADADDR;
  9919. !             usrerr("550 Cannot mail directly to programs");
  9920. !         }
  9921. !         else if (bitset(QBOGUSSHELL, a->q_alias->q_flags))
  9922. !         {
  9923. !             a->q_flags |= QBADADDR;
  9924. !             usrerr("550 User %s@%s doesn't have a valid shell for mailing to programs",
  9925. !                 a->q_alias->q_ruser, MyHostName);
  9926. !         }
  9927. !         else if (bitset(QUNSAFEADDR, a->q_alias->q_flags))
  9928. !         {
  9929. !             a->q_flags |= QBADADDR;
  9930. !             usrerr("550 Address %s is unsafe for mailing to programs",
  9931. !                 a->q_alias->q_paddr);
  9932. !         }
  9933.       }
  9934.   
  9935.       /*
  9936. ***************
  9937. *** 252,257 ****
  9938. --- 267,274 ----
  9939.                       message("duplicate suppressed");
  9940.                   q->q_flags |= a->q_flags;
  9941.               }
  9942. +             else if (bitset(QSELFREF, q->q_flags))
  9943. +                 q->q_flags |= a->q_flags & ~QDONTSEND;
  9944.               a = q;
  9945.               goto testselfdestruct;
  9946.           }
  9947. ***************
  9948. *** 294,299 ****
  9949. --- 311,317 ----
  9950.                           e->e_id, a->q_user, errstring(ret));
  9951.   #endif
  9952.                   a->q_flags |= QQUEUEUP;
  9953. +                 a->q_flags &= ~QDONTSEND;
  9954.                   usrerr("451 Cannot open %s: %s",
  9955.                       a->q_user, errstring(ret));
  9956.               }
  9957. ***************
  9958. *** 307,316 ****
  9959.       }
  9960.       else if (m == FileMailer)
  9961.       {
  9962. -         struct stat stb;
  9963.           extern bool writable();
  9964.   
  9965. -         p = strrchr(buf, '/');
  9966.           /* check if writable or creatable */
  9967.           if (a->q_alias == NULL)
  9968.           {
  9969. --- 325,332 ----
  9970. ***************
  9971. *** 317,326 ****
  9972.               a->q_flags |= QBADADDR;
  9973.               usrerr("550 Cannot mail directly to files");
  9974.           }
  9975. !         else if ((stat(buf, &stb) >= 0) ? (!writable(&stb)) :
  9976. !             (*p = '\0', safefile(buf, RealUid, RealGid, NULL, TRUE, S_IWRITE|S_IEXEC) != 0))
  9977.           {
  9978.               a->q_flags |= QBADADDR;
  9979.               giveresponse(EX_CANTCREAT, m, NULL, a->q_alias, e);
  9980.           }
  9981.       }
  9982. --- 333,353 ----
  9983.               a->q_flags |= QBADADDR;
  9984.               usrerr("550 Cannot mail directly to files");
  9985.           }
  9986. !         else if (bitset(QBOGUSSHELL, a->q_alias->q_flags))
  9987.           {
  9988.               a->q_flags |= QBADADDR;
  9989. +             usrerr("550 User %s@%s doesn't have a valid shell for mailing to files",
  9990. +                 a->q_alias->q_ruser, MyHostName);
  9991. +         }
  9992. +         else if (bitset(QUNSAFEADDR, a->q_alias->q_flags))
  9993. +         {
  9994. +             a->q_flags |= QBADADDR;
  9995. +             usrerr("550 Address %s is unsafe for mailing to files",
  9996. +                 a->q_alias->q_paddr);
  9997. +         }
  9998. +         else if (!writable(buf, getctladdr(a), SFF_ANYFILE))
  9999. +         {
  10000. +             a->q_flags |= QBADADDR;
  10001.               giveresponse(EX_CANTCREAT, m, NULL, a->q_alias, e);
  10002.           }
  10003.       }
  10004. ***************
  10005. *** 340,346 ****
  10006.       if (!bitset(QDONTSEND|QNOTREMOTE|QVERIFIED, a->q_flags))
  10007.       {
  10008.           extern int udbexpand();
  10009. -         extern int errno;
  10010.   
  10011.           if (udbexpand(a, sendq, e) == EX_TEMPFAIL)
  10012.           {
  10013. --- 367,372 ----
  10014. ***************
  10015. *** 429,434 ****
  10016. --- 455,465 ----
  10017.               buildfname(pw->pw_gecos, pw->pw_name, nbuf);
  10018.               if (nbuf[0] != '\0')
  10019.                   a->q_fullname = newstr(nbuf);
  10020. +             if (pw->pw_shell != NULL && pw->pw_shell[0] != '\0' &&
  10021. +                 !usershellok(pw->pw_shell))
  10022. +             {
  10023. +                 a->q_flags |= QBOGUSSHELL;
  10024. +             }
  10025.               if (!quoted)
  10026.                   forward(a, sendq, e);
  10027.           }
  10028. ***************
  10029. *** 563,569 ****
  10030.   **    not writable.  This is also enforced by mailfile.
  10031.   **
  10032.   **    Parameters:
  10033. ! **        s -- pointer to a stat struct for the file.
  10034.   **
  10035.   **    Returns:
  10036.   **        TRUE -- if we will be able to write this file.
  10037. --- 594,602 ----
  10038.   **    not writable.  This is also enforced by mailfile.
  10039.   **
  10040.   **    Parameters:
  10041. ! **        filename -- the file name to check.
  10042. ! **        ctladdr -- the controlling address for this file.
  10043. ! **        flags -- SFF_* flags to control the function.
  10044.   **
  10045.   **    Returns:
  10046.   **        TRUE -- if we will be able to write this file.
  10047. ***************
  10048. *** 574,608 ****
  10049.   */
  10050.   
  10051.   bool
  10052. ! writable(s)
  10053. !     register struct stat *s;
  10054.   {
  10055.       uid_t euid;
  10056.       gid_t egid;
  10057.       int bits;
  10058.   
  10059. !     if (bitset(0111, s->st_mode))
  10060. !         return (FALSE);
  10061. !     euid = RealUid;
  10062. !     egid = RealGid;
  10063. !     if (geteuid() == 0)
  10064.       {
  10065. !         if (bitset(S_ISUID, s->st_mode))
  10066. !             euid = s->st_uid;
  10067. !         if (bitset(S_ISGID, s->st_mode))
  10068. !             egid = s->st_gid;
  10069.       }
  10070.   
  10071.       if (euid == 0)
  10072. -         return (TRUE);
  10073. -     bits = S_IWRITE;
  10074. -     if (euid != s->st_uid)
  10075.       {
  10076. !         bits >>= 3;
  10077. !         if (egid != s->st_gid)
  10078. !             bits >>= 3;
  10079.       }
  10080. !     return ((s->st_mode & bits) != 0);
  10081.   }
  10082.    /*
  10083.   **  INCLUDE -- handle :include: specification.
  10084. --- 607,704 ----
  10085.   */
  10086.   
  10087.   bool
  10088. ! writable(filename, ctladdr, flags)
  10089. !     char *filename;
  10090. !     ADDRESS *ctladdr;
  10091. !     int flags;
  10092.   {
  10093.       uid_t euid;
  10094.       gid_t egid;
  10095.       int bits;
  10096. +     register char *p;
  10097. +     char *uname;
  10098. +     struct stat stb;
  10099. +     extern char RealUserName[];
  10100.   
  10101. !     if (tTd(29, 5))
  10102. !         printf("writable(%s, %x)\n", filename, flags);
  10103. ! #ifdef HASLSTAT
  10104. !     if ((bitset(SFF_NOSLINK, flags) ? lstat(filename, &stb)
  10105. !                     : stat(filename, &stb)) < 0)
  10106. ! #else
  10107. !     if (stat(filename, &stb) < 0)
  10108. ! #endif
  10109.       {
  10110. !         /* file does not exist -- see if directory is safe */
  10111. !         p = strrchr(filename, '/');
  10112. !         if (p == NULL)
  10113. !         {
  10114. !             errno = ENOTDIR;
  10115. !             return FALSE;
  10116. !         }
  10117. !         *p = '\0';
  10118. !         errno = safefile(filename, RealUid, RealGid, RealUserName,
  10119. !                  SFF_MUSTOWN, S_IWRITE|S_IEXEC);
  10120. !         *p = '/';
  10121. !         return errno == 0;
  10122.       }
  10123.   
  10124. + #ifdef SUID_ROOT_FILES_OK
  10125. +     /* really ought to be passed down -- and not a good idea */
  10126. +     flags |= SFF_ROOTOK;
  10127. + #endif
  10128. +     /*
  10129. +     **  File does exist -- check that it is writable.
  10130. +     */
  10131. +     if (bitset(0111, stb.st_mode))
  10132. +     {
  10133. +         if (tTd(29, 5))
  10134. +             printf("failed (mode %o: x bits)\n", stb.st_mode);
  10135. +         errno = EPERM;
  10136. +         return (FALSE);
  10137. +     }
  10138. +     if (ctladdr != NULL && geteuid() == 0)
  10139. +     {
  10140. +         euid = ctladdr->q_uid;
  10141. +         egid = ctladdr->q_gid;
  10142. +         uname = ctladdr->q_user;
  10143. +     }
  10144. +     else
  10145. +     {
  10146. +         euid = RealUid;
  10147. +         egid = RealGid;
  10148. +         uname = RealUserName;
  10149. +     }
  10150.       if (euid == 0)
  10151.       {
  10152. !         euid = DefUid;
  10153. !         uname = DefUser;
  10154.       }
  10155. !     if (egid == 0)
  10156. !         egid = DefGid;
  10157. !     if (geteuid() == 0)
  10158. !     {
  10159. !         if (bitset(S_ISUID, stb.st_mode) &&
  10160. !             (stb.st_uid != 0 || bitset(SFF_ROOTOK, flags)))
  10161. !         {
  10162. !             euid = stb.st_uid;
  10163. !             uname = NULL;
  10164. !         }
  10165. !         if (bitset(S_ISGID, stb.st_mode) &&
  10166. !             (stb.st_gid != 0 || bitset(SFF_ROOTOK, flags)))
  10167. !             egid = stb.st_gid;
  10168. !     }
  10169. !     if (tTd(29, 5))
  10170. !         printf("\teu/gid=%d/%d, st_u/gid=%d/%d\n",
  10171. !             euid, egid, stb.st_uid, stb.st_gid);
  10172. !     errno = safefile(filename, euid, egid, uname, flags, S_IWRITE);
  10173. !     return errno == 0;
  10174.   }
  10175.    /*
  10176.   **  INCLUDE -- handle :include: specification.
  10177. ***************
  10178. *** 628,633 ****
  10179. --- 724,733 ----
  10180.   static jmp_buf    CtxIncludeTimeout;
  10181.   static int    includetimeout();
  10182.   
  10183. + #ifndef S_IWOTH
  10184. + # define S_IWOTH    (S_IWRITE >> 6)
  10185. + #endif
  10186.   int
  10187.   include(fname, forwarding, ctladdr, sendq, e)
  10188.       char *fname;
  10189. ***************
  10190. *** 647,652 ****
  10191. --- 747,754 ----
  10192.       gid_t savedgid, gid;
  10193.       char *uname;
  10194.       int rval = 0;
  10195. +     int sfflags = forwarding ? SFF_MUSTOWN : SFF_ANYFILE;
  10196. +     struct stat st;
  10197.       char buf[MAXLINE];
  10198.   
  10199.       if (tTd(27, 2))
  10200. ***************
  10201. *** 665,673 ****
  10202.       ca = getctladdr(ctladdr);
  10203.       if (ca == NULL)
  10204.       {
  10205. !         uid = 0;
  10206. !         gid = 0;
  10207. !         uname = NULL;
  10208.           saveduid = -1;
  10209.       }
  10210.       else
  10211. --- 767,775 ----
  10212.       ca = getctladdr(ctladdr);
  10213.       if (ca == NULL)
  10214.       {
  10215. !         uid = DefUid;
  10216. !         gid = DefGid;
  10217. !         uname = DefUser;
  10218.           saveduid = -1;
  10219.       }
  10220.       else
  10221. ***************
  10222. *** 699,705 ****
  10223.       {
  10224.           ctladdr->q_flags |= QQUEUEUP;
  10225.           errno = 0;
  10226. -         usrerr("451 open timeout on %s", fname);
  10227.   
  10228.           /* return pseudo-error code */
  10229.           rval = EOPENTIMEOUT;
  10230. --- 801,806 ----
  10231. ***************
  10232. *** 708,748 ****
  10233.       ev = setevent((time_t) 60, includetimeout, 0);
  10234.   
  10235.       /* the input file must be marked safe */
  10236. !     rval = safefile(fname, uid, gid, uname, forwarding, S_IREAD);
  10237.       if (rval != 0)
  10238.       {
  10239.           /* don't use this :include: file */
  10240. -         clrevent(ev);
  10241.           if (tTd(27, 4))
  10242.               printf("include: not safe (uid=%d): %s\n",
  10243.                   uid, errstring(rval));
  10244. -         goto resetuid;
  10245.       }
  10246. !     fp = fopen(fname, "r");
  10247. !     if (fp == NULL)
  10248.       {
  10249. !         rval = errno;
  10250. !         if (tTd(27, 4))
  10251. !             printf("include: open: %s\n", errstring(rval));
  10252. !     }
  10253. !     else if (ca == NULL)
  10254. !     {
  10255. !         struct stat st;
  10256. !         if (fstat(fileno(fp), &st) < 0)
  10257.           {
  10258.               rval = errno;
  10259. !             syserr("Cannot fstat %s!", fname);
  10260.           }
  10261. -         else
  10262. -         {
  10263. -             ctladdr->q_uid = st.st_uid;
  10264. -             ctladdr->q_gid = st.st_gid;
  10265. -             ctladdr->q_flags |= QGOODUID;
  10266. -         }
  10267.       }
  10268.       clrevent(ev);
  10269.   
  10270.   resetuid:
  10271. --- 809,832 ----
  10272.       ev = setevent((time_t) 60, includetimeout, 0);
  10273.   
  10274.       /* the input file must be marked safe */
  10275. !     rval = safefile(fname, uid, gid, uname, sfflags, S_IREAD);
  10276.       if (rval != 0)
  10277.       {
  10278.           /* don't use this :include: file */
  10279.           if (tTd(27, 4))
  10280.               printf("include: not safe (uid=%d): %s\n",
  10281.                   uid, errstring(rval));
  10282.       }
  10283. !     else
  10284.       {
  10285. !         fp = fopen(fname, "r");
  10286. !         if (fp == NULL)
  10287.           {
  10288.               rval = errno;
  10289. !             if (tTd(27, 4))
  10290. !                 printf("include: open: %s\n", errstring(rval));
  10291.           }
  10292.       }
  10293.       clrevent(ev);
  10294.   
  10295.   resetuid:
  10296. ***************
  10297. *** 761,769 ****
  10298. --- 845,887 ----
  10299.       if (tTd(27, 9))
  10300.           printf("include: reset uid = %d/%d\n", getuid(), geteuid());
  10301.   
  10302. +     if (rval == EOPENTIMEOUT)
  10303. +         usrerr("451 open timeout on %s", fname);
  10304.       if (fp == NULL)
  10305.           return rval;
  10306.   
  10307. +     if (fstat(fileno(fp), &st) < 0)
  10308. +     {
  10309. +         rval = errno;
  10310. +         syserr("Cannot fstat %s!", fname);
  10311. +         return rval;
  10312. +     }
  10313. +     if (ca == NULL)
  10314. +     {
  10315. +         ctladdr->q_uid = st.st_uid;
  10316. +         ctladdr->q_gid = st.st_gid;
  10317. +         ctladdr->q_flags |= QGOODUID;
  10318. +     }
  10319. +     if (ca != NULL && ca->q_uid == st.st_uid)
  10320. +     {
  10321. +         /* optimization -- avoid getpwuid if we already have info */
  10322. +         ctladdr->q_flags |= ca->q_flags & QBOGUSSHELL;
  10323. +         ctladdr->q_ruser = ca->q_ruser;
  10324. +     }
  10325. +     else
  10326. +     {
  10327. +         register struct passwd *pw;
  10328. +         pw = getpwuid(st.st_uid);
  10329. +         if (pw == NULL || !usershellok(pw->pw_shell))
  10330. +         {
  10331. +             ctladdr->q_ruser = newstr(pw->pw_name);
  10332. +             ctladdr->q_flags |= QBOGUSSHELL;
  10333. +         }
  10334. +     }
  10335.       if (bitset(EF_VRFYONLY, e->e_flags))
  10336.       {
  10337.           /* don't do any more now */
  10338. ***************
  10339. *** 772,777 ****
  10340. --- 890,908 ----
  10341.           xfclose(fp, "include", fname);
  10342.           return rval;
  10343.       }
  10344. +     /*
  10345. +     ** Check to see if some bad guy can write this file
  10346. +     **
  10347. +     **    This should really do something clever with group
  10348. +     **    permissions; currently we just view world writable
  10349. +     **    as unsafe.  Also, we don't check for writable
  10350. +     **    directories in the path.  We've got to leave
  10351. +     **    something for the local sysad to do.
  10352. +     */
  10353. +     if (bitset(S_IWOTH, st.st_mode))
  10354. +         ctladdr->q_flags |= QUNSAFEADDR;
  10355.   
  10356.       /* read the file -- each line is a comma-separated list. */
  10357.       FileName = fname;
  10358. *** src/savemail.c.OLD    Mon Nov 22 11:50:07 1993
  10359. --- src/savemail.c    Sat Dec 18 06:25:06 1993
  10360. ***************
  10361. *** 33,39 ****
  10362.    */
  10363.   
  10364.   #ifndef lint
  10365. ! static char sccsid[] = "@(#)savemail.c    8.17 (Berkeley) 10/31/93";
  10366.   #endif /* not lint */
  10367.   
  10368.   # include "sendmail.h"
  10369. --- 33,39 ----
  10370.    */
  10371.   
  10372.   #ifndef lint
  10373. ! static char sccsid[] = "@(#)savemail.c    8.24 (Berkeley) 12/18/93";
  10374.   #endif /* not lint */
  10375.   
  10376.   # include "sendmail.h"
  10377. ***************
  10378. *** 69,75 ****
  10379. --- 69,79 ----
  10380.   # define ESM_PANIC    6    /* leave the locked queue/transcript files */
  10381.   # define ESM_DONE    7    /* the message is successfully delivered */
  10382.   
  10383. + # ifndef _PATH_VARTMP
  10384. + #  define _PATH_VARTMP    "/usr/tmp/"
  10385. + # endif
  10386.   
  10387.   savemail(e)
  10388.       register ENVELOPE *e;
  10389.   {
  10390. ***************
  10391. *** 82,87 ****
  10392. --- 86,92 ----
  10393.       register char *p;
  10394.       extern char *ttypath();
  10395.       typedef int (*fnptr)();
  10396. +     extern bool writable();
  10397.   
  10398.       if (tTd(6, 1))
  10399.       {
  10400. ***************
  10401. *** 374,381 ****
  10402.                   break;
  10403.               }
  10404.   
  10405. !             fp = dfopen("/usr/tmp/dead.letter",
  10406. !                     O_WRONLY|O_CREAT|O_APPEND, FileMode);
  10407.               if (fp == NULL)
  10408.               {
  10409.                   state = ESM_PANIC;
  10410. --- 379,392 ----
  10411.                   break;
  10412.               }
  10413.   
  10414. !             strcpy(buf, _PATH_VARTMP);
  10415. !             strcat(buf, "dead.letter");
  10416. !             if (!writable(buf, NULLADDR, SFF_NOSLINK))
  10417. !             {
  10418. !                 state = ESM_PANIC;
  10419. !                 break;
  10420. !             }
  10421. !             fp = dfopen(buf, O_WRONLY|O_CREAT|O_APPEND, FileMode);
  10422.               if (fp == NULL)
  10423.               {
  10424.                   state = ESM_PANIC;
  10425. ***************
  10426. *** 399,406 ****
  10427.   
  10428.             case ESM_PANIC:
  10429.               /* leave the locked queue & transcript files around */
  10430. !             syserr("554 savemail: cannot save rejected email anywhere");
  10431. !             exit(EX_SOFTWARE);
  10432.           }
  10433.       }
  10434.   }
  10435. --- 410,416 ----
  10436.   
  10437.             case ESM_PANIC:
  10438.               /* leave the locked queue & transcript files around */
  10439. !             syserr("!554 savemail: cannot save rejected email anywhere");
  10440.           }
  10441.       }
  10442.   }
  10443. ***************
  10444. *** 466,471 ****
  10445. --- 476,482 ----
  10446.   
  10447.       SendBody = sendbody;
  10448.       define('g', e->e_from.q_paddr, e);
  10449. +     define('u', NULL, e);
  10450.       ee = newenvelope(&errenvelope, e);
  10451.       define('a', "\201b", ee);
  10452.       define('r', "internal", ee);
  10453. ***************
  10454. *** 602,608 ****
  10455.       for (q = e->e_parent->e_sendqueue; q != NULL; q = q->q_next)
  10456.           if (bitset(QBADADDR, q->q_flags))
  10457.               break;
  10458. !     if (q == NULL && !bitset(EF_FATALERRS, e->e_parent->e_flags))
  10459.       {
  10460.           putline("    **********************************************",
  10461.               fp, m);
  10462. --- 613,620 ----
  10463.       for (q = e->e_parent->e_sendqueue; q != NULL; q = q->q_next)
  10464.           if (bitset(QBADADDR, q->q_flags))
  10465.               break;
  10466. !     if (q == NULL &&
  10467. !         !bitset(EF_FATALERRS|EF_SENDRECEIPT, e->e_parent->e_flags))
  10468.       {
  10469.           putline("    **********************************************",
  10470.               fp, m);
  10471. *** src/sendmail.h.OLD    Sun Nov  7 10:37:14 1993
  10472. --- src/sendmail.h    Wed Jan  5 08:34:35 1994
  10473. ***************
  10474. *** 31,37 ****
  10475.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  10476.    * SUCH DAMAGE.
  10477.    *
  10478. !  *    @(#)sendmail.h    8.26 (Berkeley) 10/31/93
  10479.    */
  10480.   
  10481.   /*
  10482. --- 31,37 ----
  10483.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  10484.    * SUCH DAMAGE.
  10485.    *
  10486. !  *    @(#)sendmail.h    8.38 (Berkeley) 1/5/94
  10487.    */
  10488.   
  10489.   /*
  10490. ***************
  10491. *** 41,47 ****
  10492.   # ifdef _DEFINE
  10493.   # define EXTERN
  10494.   # ifndef lint
  10495. ! static char SmailSccsId[] =    "@(#)sendmail.h    8.26        10/31/93";
  10496.   # endif
  10497.   # else /*  _DEFINE */
  10498.   # define EXTERN extern
  10499. --- 41,47 ----
  10500.   # ifdef _DEFINE
  10501.   # define EXTERN
  10502.   # ifndef lint
  10503. ! static char SmailSccsId[] =    "@(#)sendmail.h    8.38        1/5/94";
  10504.   # endif
  10505.   # else /*  _DEFINE */
  10506.   # define EXTERN extern
  10507. ***************
  10508. *** 57,63 ****
  10509.   # include <string.h>
  10510.   # include <time.h>
  10511.   # include <errno.h>
  10512. - # include <sys/un.h>
  10513.   
  10514.   # include "conf.h"
  10515.   # include "useful.h"
  10516. --- 57,62 ----
  10517. ***************
  10518. *** 69,74 ****
  10519. --- 68,76 ----
  10520.   # ifdef DAEMON
  10521.   # include <sys/socket.h>
  10522.   # endif
  10523. + # ifdef NETUNIX
  10524. + # include <sys/un.h>
  10525. + # endif
  10526.   # ifdef NETINET
  10527.   # include <netinet/in.h>
  10528.   # endif
  10529. ***************
  10530. *** 148,153 ****
  10531. --- 150,157 ----
  10532.   # define QSELFREF    000200    /* this address references itself */
  10533.   # define QVERIFIED    000400    /* verified, but not expanded */
  10534.   # define QREPORT    001000    /* report this address in return message */
  10535. + # define QBOGUSSHELL    002000    /* this entry has an invalid shell listed */
  10536. + # define QUNSAFEADDR    004000    /* address aquired through an unsafe path */
  10537.   
  10538.   # define NULLADDR    ((ADDRESS *) NULL)
  10539.    /*
  10540. ***************
  10541. *** 287,295 ****
  10542.       ADDRESS        *e_sendqueue;    /* list of message recipients */
  10543.       ADDRESS        *e_errorqueue;    /* the queue for error responses */
  10544.       long        e_msgsize;    /* size of the message in bytes */
  10545.       int        e_nrcpts;    /* number of recipients */
  10546.       short        e_class;    /* msg class (priority, junk, etc.) */
  10547. -     short        e_flags;    /* flags, see below */
  10548.       short        e_hopcount;    /* number of times processed */
  10549.       short        e_nsent;    /* number of sends since checkpoint */
  10550.       short        e_sendmode;    /* message send mode */
  10551. --- 291,299 ----
  10552.       ADDRESS        *e_sendqueue;    /* list of message recipients */
  10553.       ADDRESS        *e_errorqueue;    /* the queue for error responses */
  10554.       long        e_msgsize;    /* size of the message in bytes */
  10555. +     long        e_flags;    /* flags, see below */
  10556.       int        e_nrcpts;    /* number of recipients */
  10557.       short        e_class;    /* msg class (priority, junk, etc.) */
  10558.       short        e_hopcount;    /* number of times processed */
  10559.       short        e_nsent;    /* number of sends since checkpoint */
  10560.       short        e_sendmode;    /* message send mode */
  10561. ***************
  10562. *** 314,333 ****
  10563.   };
  10564.   
  10565.   /* values for e_flags */
  10566. ! #define EF_OLDSTYLE    000001        /* use spaces (not commas) in hdrs */
  10567. ! #define EF_INQUEUE    000002        /* this message is fully queued */
  10568. ! #define EF_CLRQUEUE    000010        /* disk copy is no longer needed */
  10569. ! #define EF_SENDRECEIPT    000020        /* send a return receipt */
  10570. ! #define EF_FATALERRS    000040        /* fatal errors occured */
  10571. ! #define EF_KEEPQUEUE    000100        /* keep queue files always */
  10572. ! #define EF_RESPONSE    000200        /* this is an error or return receipt */
  10573. ! #define EF_RESENT    000400        /* this message is being forwarded */
  10574. ! #define EF_VRFYONLY    001000        /* verify only (don't expand aliases) */
  10575. ! #define EF_WARNING    002000        /* warning message has been sent */
  10576. ! #define EF_QUEUERUN    004000        /* this envelope is from queue */
  10577. ! #define EF_GLOBALERRS    010000        /* treat errors as global */
  10578. ! #define EF_PM_NOTIFY    020000        /* send return mail to postmaster */
  10579. ! #define EF_METOO    040000        /* send to me too */
  10580.   
  10581.   EXTERN ENVELOPE    *CurEnv;    /* envelope currently being processed */
  10582.    /*
  10583. --- 318,338 ----
  10584.   };
  10585.   
  10586.   /* values for e_flags */
  10587. ! #define EF_OLDSTYLE    0x0000001    /* use spaces (not commas) in hdrs */
  10588. ! #define EF_INQUEUE    0x0000002    /* this message is fully queued */
  10589. ! #define EF_CLRQUEUE    0x0000008    /* disk copy is no longer needed */
  10590. ! #define EF_SENDRECEIPT    0x0000010    /* send a return receipt */
  10591. ! #define EF_FATALERRS    0x0000020    /* fatal errors occured */
  10592. ! #define EF_KEEPQUEUE    0x0000040    /* keep queue files always */
  10593. ! #define EF_RESPONSE    0x0000080    /* this is an error or return receipt */
  10594. ! #define EF_RESENT    0x0000100    /* this message is being forwarded */
  10595. ! #define EF_VRFYONLY    0x0000200    /* verify only (don't expand aliases) */
  10596. ! #define EF_WARNING    0x0000400    /* warning message has been sent */
  10597. ! #define EF_QUEUERUN    0x0000800    /* this envelope is from queue */
  10598. ! #define EF_GLOBALERRS    0x0001000    /* treat errors as global */
  10599. ! #define EF_PM_NOTIFY    0x0002000    /* send return mail to postmaster */
  10600. ! #define EF_METOO    0x0004000    /* send to me too */
  10601. ! #define EF_LOGSENDER    0x0008000    /* need to log the sender */
  10602.   
  10603.   EXTERN ENVELOPE    *CurEnv;    /* envelope currently being processed */
  10604.    /*
  10605. ***************
  10606. *** 722,728 ****
  10607. --- 727,744 ----
  10608.   #define RF_COPYALL        (RF_COPYPARSE|RF_COPYPADDR)
  10609.   #define RF_COPYNONE        0
  10610.   
  10611.   /*
  10612. + **  Flags passed to safefile.
  10613. + */
  10614. + #define SFF_ANYFILE        0    /* no special restrictions */
  10615. + #define SFF_MUSTOWN        0x0001    /* user must own this file */
  10616. + #define SFF_NOSLINK        0x0002    /* file cannot be a symbolic link */
  10617. + #define SFF_ROOTOK        0x0004    /* ok for root to own this file */
  10618. + /*
  10619.   **  Regular UNIX sockaddrs are too small to handle ISO addresses, so
  10620.   **  we are forced to declare a supertype here.
  10621.   */
  10622. ***************
  10623. *** 730,736 ****
  10624. --- 746,754 ----
  10625.   union bigsockaddr
  10626.   {
  10627.       struct sockaddr        sa;    /* general version */
  10628. + #ifdef NETUNIX
  10629.       struct sockaddr_un    sunix;    /* UNIX family */
  10630. + #endif
  10631.   #ifdef NETINET
  10632.       struct sockaddr_in    sin;    /* INET family */
  10633.   #endif
  10634. ***************
  10635. *** 804,810 ****
  10636.   EXTERN bool    MatchGecos;    /* look for user names in gecos field */
  10637.   EXTERN bool    UseErrorsTo;    /* use Errors-To: header (back compat) */
  10638.   EXTERN bool    TryNullMXList;    /* if we are the best MX, try host directly */
  10639. ! EXTERN bool    CheckLoopBack;    /* check for loopback on HELO packet */
  10640.   EXTERN bool    InChild;    /* true if running in an SMTP subprocess */
  10641.   EXTERN char    SpaceSub;    /* substitution for <lwsp> */
  10642.   EXTERN int    PrivacyFlags;    /* privacy flags */
  10643. --- 822,828 ----
  10644.   EXTERN bool    MatchGecos;    /* look for user names in gecos field */
  10645.   EXTERN bool    UseErrorsTo;    /* use Errors-To: header (back compat) */
  10646.   EXTERN bool    TryNullMXList;    /* if we are the best MX, try host directly */
  10647. ! extern bool    CheckLoopBack;    /* check for loopback on HELO packet */
  10648.   EXTERN bool    InChild;    /* true if running in an SMTP subprocess */
  10649.   EXTERN char    SpaceSub;    /* substitution for <lwsp> */
  10650.   EXTERN int    PrivacyFlags;    /* privacy flags */
  10651. ***************
  10652. *** 825,831 ****
  10653.   EXTERN char    *PostMasterCopy;    /* address to get errs cc's */
  10654.   EXTERN int    CheckpointInterval;    /* queue file checkpoint interval */
  10655.   EXTERN bool    DontPruneRoutes;    /* don't prune source routes */
  10656. ! EXTERN bool    BrokenSmtpPeers;    /* peers can't handle 2-line greeting */
  10657.   EXTERN int    MaxMciCache;        /* maximum entries in MCI cache */
  10658.   EXTERN time_t    MciCacheTimeout;    /* maximum idle time on connections */
  10659.   EXTERN char    *QueueLimitRecipient;    /* limit queue runs to this recipient */
  10660. --- 843,849 ----
  10661.   EXTERN char    *PostMasterCopy;    /* address to get errs cc's */
  10662.   EXTERN int    CheckpointInterval;    /* queue file checkpoint interval */
  10663.   EXTERN bool    DontPruneRoutes;    /* don't prune source routes */
  10664. ! extern bool    BrokenSmtpPeers;    /* peers can't handle 2-line greeting */
  10665.   EXTERN int    MaxMciCache;        /* maximum entries in MCI cache */
  10666.   EXTERN time_t    MciCacheTimeout;    /* maximum idle time on connections */
  10667.   EXTERN char    *QueueLimitRecipient;    /* limit queue runs to this recipient */
  10668. ***************
  10669. *** 832,837 ****
  10670. --- 850,856 ----
  10671.   EXTERN char    *QueueLimitSender;    /* limit queue runs to this sender */
  10672.   EXTERN char    *QueueLimitId;        /* limit queue runs to this id */
  10673.   EXTERN FILE    *TrafficLogFile;    /* file in which to log all traffic */
  10674. + extern int    errno;
  10675.   
  10676.   
  10677.   /*
  10678. ***************
  10679. *** 909,915 ****
  10680.   extern void        expand __P((char *, char *, char *, ENVELOPE *));
  10681.   extern void        define __P((int, char *, ENVELOPE *));
  10682.   extern char        *macvalue __P((int, ENVELOPE *));
  10683. ! extern char        **prescan __P((char *, int, char[], char **));
  10684.   extern char        *fgetfolded __P((char *, int, FILE *));
  10685.   extern ADDRESS        *recipient __P((ADDRESS *, ADDRESS **, ENVELOPE *));
  10686.   extern ENVELOPE        *newenvelope __P((ENVELOPE *, ENVELOPE *));
  10687. --- 928,935 ----
  10688.   extern void        expand __P((char *, char *, char *, ENVELOPE *));
  10689.   extern void        define __P((int, char *, ENVELOPE *));
  10690.   extern char        *macvalue __P((int, ENVELOPE *));
  10691. ! extern char        **prescan __P((char *, int, char[], int, char **));
  10692. ! extern int        rewrite __P((char **, int, int, ENVELOPE *));
  10693.   extern char        *fgetfolded __P((char *, int, FILE *));
  10694.   extern ADDRESS        *recipient __P((ADDRESS *, ADDRESS **, ENVELOPE *));
  10695.   extern ENVELOPE        *newenvelope __P((ENVELOPE *, ENVELOPE *));
  10696. ***************
  10697. *** 928,933 ****
  10698. --- 948,955 ----
  10699.   extern void        openxscript __P((ENVELOPE *));
  10700.   extern void        closexscript __P((ENVELOPE *));
  10701.   extern sigfunc_t    setsignal __P((int, sigfunc_t));
  10702. + extern char        *shortenstring __P((char *, int));
  10703. + extern bool        usershellok __P((char *));
  10704.   
  10705.   /* ellipsis is a different case though */
  10706.   #ifdef __STDC__
  10707. *** src/srvrsmtp.c.OLD    Fri Nov 26 17:21:59 1993
  10708. --- src/srvrsmtp.c    Wed Dec 22 05:07:01 1993
  10709. ***************
  10710. *** 36,44 ****
  10711.   
  10712.   #ifndef lint
  10713.   #ifdef SMTP
  10714. ! static char sccsid[] = "@(#)srvrsmtp.c    8.18 (Berkeley) 10/28/93 (with SMTP)";
  10715.   #else
  10716. ! static char sccsid[] = "@(#)srvrsmtp.c    8.18 (Berkeley) 10/28/93 (without SMTP)";
  10717.   #endif
  10718.   #endif /* not lint */
  10719.   
  10720. --- 36,44 ----
  10721.   
  10722.   #ifndef lint
  10723.   #ifdef SMTP
  10724. ! static char sccsid[] = "@(#)srvrsmtp.c    8.23 (Berkeley) 12/21/93 (with SMTP)";
  10725.   #else
  10726. ! static char sccsid[] = "@(#)srvrsmtp.c    8.23 (Berkeley) 12/21/93 (without SMTP)";
  10727.   #endif
  10728.   #endif /* not lint */
  10729.   
  10730. ***************
  10731. *** 114,119 ****
  10732. --- 114,120 ----
  10733.   };
  10734.   
  10735.   bool    OneXact = FALSE;        /* one xaction only this run */
  10736. + char    *CurSmtpClient;            /* who's at the other end of channel */
  10737.   
  10738.   static char    *skipword();
  10739.   
  10740. ***************
  10741. *** 147,153 ****
  10742.       }
  10743.       settime(e);
  10744.       CurHostName = RealHostName;
  10745. !     setproctitle("server %s startup", CurHostName);
  10746.       expand("\201e", inp, &inp[sizeof inp], e);
  10747.       if (BrokenSmtpPeers)
  10748.       {
  10749. --- 148,158 ----
  10750.       }
  10751.       settime(e);
  10752.       CurHostName = RealHostName;
  10753. !     CurSmtpClient = macvalue('_', e);
  10754. !     if (CurSmtpClient == NULL)
  10755. !         CurSmtpClient = RealHostName;
  10756. !     setproctitle("server %s startup", CurSmtpClient);
  10757.       expand("\201e", inp, &inp[sizeof inp], e);
  10758.       if (BrokenSmtpPeers)
  10759.       {
  10760. ***************
  10761. *** 192,202 ****
  10762.           {
  10763.               /* end of file, just die */
  10764.               message("421 %s Lost input channel from %s",
  10765. !                 MyHostName, CurHostName);
  10766.   #ifdef LOG
  10767.               if (LogLevel > (gotmail ? 1 : 19))
  10768.                   syslog(LOG_NOTICE, "lost input channel from %s",
  10769. !                     CurHostName);
  10770.   #endif
  10771.               if (InChild)
  10772.                   ExitStat = EX_QUIT;
  10773. --- 197,207 ----
  10774.           {
  10775.               /* end of file, just die */
  10776.               message("421 %s Lost input channel from %s",
  10777. !                 MyHostName, CurSmtpClient);
  10778.   #ifdef LOG
  10779.               if (LogLevel > (gotmail ? 1 : 19))
  10780.                   syslog(LOG_NOTICE, "lost input channel from %s",
  10781. !                     CurSmtpClient);
  10782.   #endif
  10783.               if (InChild)
  10784.                   ExitStat = EX_QUIT;
  10785. ***************
  10786. *** 211,219 ****
  10787.               fprintf(e->e_xfp, "<<< %s\n", inp);
  10788.   
  10789.           if (e->e_id == NULL)
  10790. !             setproctitle("%s: %s", CurHostName, inp);
  10791.           else
  10792. !             setproctitle("%s %s: %s", e->e_id, CurHostName, inp);
  10793.   
  10794.           /* break off command */
  10795.           for (p = inp; isascii(*p) && isspace(*p); p++)
  10796. --- 216,224 ----
  10797.               fprintf(e->e_xfp, "<<< %s\n", inp);
  10798.   
  10799.           if (e->e_id == NULL)
  10800. !             setproctitle("%s: %.80s", CurSmtpClient, inp);
  10801.           else
  10802. !             setproctitle("%s %s: %.80s", e->e_id, CurSmtpClient, inp);
  10803.   
  10804.           /* break off command */
  10805.           for (p = inp; isascii(*p) && isspace(*p); p++)
  10806. ***************
  10807. *** 262,270 ****
  10808.                   auth_warning(e, "Host %s claimed to be %s",
  10809.                       RealHostName, p);
  10810.               }
  10811. -             p = macvalue('_', e);
  10812. -             if (p == NULL)
  10813. -                 p = RealHostName;
  10814.   
  10815.               gothello = TRUE;
  10816.               if (c->cmdcode != CMDEHLO)
  10817. --- 267,272 ----
  10818. ***************
  10819. *** 271,277 ****
  10820.               {
  10821.                   /* print old message and be done with it */
  10822.                   message("250 %s Hello %s, pleased to meet you",
  10823. !                     MyHostName, p);
  10824.                   break;
  10825.               }
  10826.               
  10827. --- 273,279 ----
  10828.               {
  10829.                   /* print old message and be done with it */
  10830.                   message("250 %s Hello %s, pleased to meet you",
  10831. !                     MyHostName, CurSmtpClient);
  10832.                   break;
  10833.               }
  10834.               
  10835. ***************
  10836. *** 332,338 ****
  10837.               define('s', sendinghost, e);
  10838.               initsys(e);
  10839.               nrcpts = 0;
  10840. !             setproctitle("%s %s: %s", e->e_id, CurHostName, inp);
  10841.   
  10842.               /* child -- go do the processing */
  10843.               p = skipword(p, "from");
  10844. --- 334,341 ----
  10845.               define('s', sendinghost, e);
  10846.               initsys(e);
  10847.               nrcpts = 0;
  10848. !             e->e_flags |= EF_LOGSENDER;
  10849. !             setproctitle("%s %s: %.80s", e->e_id, CurSmtpClient, inp);
  10850.   
  10851.               /* child -- go do the processing */
  10852.               p = skipword(p, "from");
  10853. ***************
  10854. *** 626,632 ****
  10855.                   if (vrfy)
  10856.                       message("252 Who's to say?");
  10857.                   else
  10858. !                     message("502 That's none of your business");
  10859.                   break;
  10860.               }
  10861.               else if (!gothello &&
  10862. --- 629,640 ----
  10863.                   if (vrfy)
  10864.                       message("252 Who's to say?");
  10865.                   else
  10866. !                     message("502 Sorry, we do not allow this operation");
  10867. ! #ifdef LOG
  10868. !                 if (LogLevel > 5)
  10869. !                     syslog(LOG_INFO, "%s: %s [rejected]",
  10870. !                         CurSmtpClient, inp);
  10871. ! #endif
  10872.                   break;
  10873.               }
  10874.               else if (!gothello &&
  10875. ***************
  10876. *** 640,646 ****
  10877.                   break;
  10878.   #ifdef LOG
  10879.               if (LogLevel > 5)
  10880. !                 syslog(LOG_INFO, "%s: %s", CurHostName, inp);
  10881.   #endif
  10882.               vrfyqueue = NULL;
  10883.               QuickAbort = TRUE;
  10884. --- 648,654 ----
  10885.                   break;
  10886.   #ifdef LOG
  10887.               if (LogLevel > 5)
  10888. !                 syslog(LOG_INFO, "%s: %s", CurSmtpClient, inp);
  10889.   #endif
  10890.               vrfyqueue = NULL;
  10891.               QuickAbort = TRUE;
  10892. ***************
  10893. *** 942,947 ****
  10894. --- 950,958 ----
  10895.               st = waitfor(childpid);
  10896.               if (st == -1)
  10897.                   syserr("%s: lost child", label);
  10898. +             else if (!WIFEXITED(st))
  10899. +                 syserr("%s: died on signal %d",
  10900. +                     label, st & 0177);
  10901.   
  10902.               /* if we exited on a QUIT command, complete the process */
  10903.               if (st == (EX_QUIT << 8))
  10904. *** src/udb.c.OLD    Thu Nov 25 08:54:38 1993
  10905. --- src/udb.c    Thu Nov 25 11:23:27 1993
  10906. ***************
  10907. *** 36,44 ****
  10908.   
  10909.   #ifndef lint
  10910.   #ifdef USERDB
  10911. ! static char sccsid [] = "@(#)udb.c    8.3 (Berkeley) 8/25/93 (with USERDB)";
  10912.   #else
  10913. ! static char sccsid [] = "@(#)udb.c    8.3 (Berkeley) 8/25/93 (without USERDB)";
  10914.   #endif
  10915.   #endif
  10916.   
  10917. --- 36,44 ----
  10918.   
  10919.   #ifndef lint
  10920.   #ifdef USERDB
  10921. ! static char sccsid [] = "@(#)udb.c    8.4 (Berkeley) 11/25/93 (with USERDB)";
  10922.   #else
  10923. ! static char sccsid [] = "@(#)udb.c    8.4 (Berkeley) 11/25/93 (without USERDB)";
  10924.   #endif
  10925.   #endif
  10926.   
  10927. ***************
  10928. *** 603,609 ****
  10929.                   up->udb_addr.sin_family = h->h_addrtype;
  10930.                   bcopy(h->h_addr_list[0],
  10931.                         (char *) &up->udb_addr.sin_addr,
  10932. !                       h->h_length);
  10933.                   up->udb_addr.sin_port = UdbPort;
  10934.                   up->udb_timeout = UdbTimeout;
  10935.                   up++;
  10936. --- 603,609 ----
  10937.                   up->udb_addr.sin_family = h->h_addrtype;
  10938.                   bcopy(h->h_addr_list[0],
  10939.                         (char *) &up->udb_addr.sin_addr,
  10940. !                       sizeof up->udb_addr.sin_addr);
  10941.                   up->udb_addr.sin_port = UdbPort;
  10942.                   up->udb_timeout = UdbTimeout;
  10943.                   up++;
  10944. *** src/usersmtp.c.OLD    Sun Nov  7 15:33:58 1993
  10945. --- src/usersmtp.c    Wed Jan  5 09:20:15 1994
  10946. ***************
  10947. *** 36,44 ****
  10948.   
  10949.   #ifndef lint
  10950.   #ifdef SMTP
  10951. ! static char sccsid[] = "@(#)usersmtp.c    8.13 (Berkeley) 10/24/93 (with SMTP)";
  10952.   #else
  10953. ! static char sccsid[] = "@(#)usersmtp.c    8.13 (Berkeley) 10/24/93 (without SMTP)";
  10954.   #endif
  10955.   #endif /* not lint */
  10956.   
  10957. --- 36,44 ----
  10958.   
  10959.   #ifndef lint
  10960.   #ifdef SMTP
  10961. ! static char sccsid[] = "@(#)usersmtp.c    8.17 (Berkeley) 1/5/94 (with SMTP)";
  10962.   #else
  10963. ! static char sccsid[] = "@(#)usersmtp.c    8.17 (Berkeley) 1/5/94 (without SMTP)";
  10964.   #endif
  10965.   #endif /* not lint */
  10966.   
  10967. ***************
  10968. *** 218,226 ****
  10969.               goto tempfail2;
  10970.       }
  10971.   
  10972. !     mci->mci_state = MCIS_OPEN;
  10973. !     return;
  10974.   
  10975.     tempfail1:
  10976.     tempfail2:
  10977.       mci->mci_exitstat = EX_TEMPFAIL;
  10978. --- 218,231 ----
  10979.               goto tempfail2;
  10980.       }
  10981.   
  10982. !     if (mci->mci_state != MCIS_CLOSED)
  10983. !     {
  10984. !         mci->mci_state = MCIS_OPEN;
  10985. !         return;
  10986. !     }
  10987.   
  10988. +     /* got a 421 error code during startup */
  10989.     tempfail1:
  10990.     tempfail2:
  10991.       mci->mci_exitstat = EX_TEMPFAIL;
  10992. ***************
  10993. *** 317,322 ****
  10994. --- 322,328 ----
  10995.       ENVELOPE *e;
  10996.   {
  10997.       int r;
  10998. +     char *bufp;
  10999.       char buf[MAXNAME];
  11000.       char optbuf[MAXLINE];
  11001.   
  11002. ***************
  11003. *** 341,355 ****
  11004.           (void) strcpy(buf, "");
  11005.       else
  11006.           expand("\201g", buf, &buf[sizeof buf - 1], e);
  11007.       if (e->e_from.q_mailer == LocalMailer ||
  11008.           !bitnset(M_FROMPATH, m->m_flags))
  11009.       {
  11010. !         smtpmessage("MAIL From:<%s>%s", m, mci, buf, optbuf);
  11011.       }
  11012.       else
  11013.       {
  11014.           smtpmessage("MAIL From:<@%s%c%s>%s", m, mci, MyHostName,
  11015. !             buf[0] == '@' ? ',' : ':', buf, optbuf);
  11016.       }
  11017.       SmtpPhase = mci->mci_phase = "client MAIL";
  11018.       setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
  11019. --- 347,371 ----
  11020.           (void) strcpy(buf, "");
  11021.       else
  11022.           expand("\201g", buf, &buf[sizeof buf - 1], e);
  11023. +     if (buf[0] == '<')
  11024. +     {
  11025. +         /* strip off <angle brackets> (put back on below) */
  11026. +         bufp = &buf[strlen(buf) - 1];
  11027. +         if (*bufp == '>')
  11028. +             *bufp = '\0';
  11029. +         bufp = &buf[1];
  11030. +     }
  11031. +     else
  11032. +         bufp = buf;
  11033.       if (e->e_from.q_mailer == LocalMailer ||
  11034.           !bitnset(M_FROMPATH, m->m_flags))
  11035.       {
  11036. !         smtpmessage("MAIL From:<%s>%s", m, mci, bufp, optbuf);
  11037.       }
  11038.       else
  11039.       {
  11040.           smtpmessage("MAIL From:<@%s%c%s>%s", m, mci, MyHostName,
  11041. !             *bufp == '@' ? ',' : ':', bufp, optbuf);
  11042.       }
  11043.       SmtpPhase = mci->mci_phase = "client MAIL";
  11044.       setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
  11045. ***************
  11046. *** 594,601 ****
  11047.       register MCI *mci;
  11048.       ENVELOPE *e;
  11049.   {
  11050. !     int i;
  11051.   
  11052.       /* send the quit message if we haven't gotten I/O error */
  11053.       if (mci->mci_state != MCIS_ERROR)
  11054.       {
  11055. --- 610,626 ----
  11056.       register MCI *mci;
  11057.       ENVELOPE *e;
  11058.   {
  11059. !     bool oldSuprErrs = SuprErrs;
  11060.   
  11061. +     /*
  11062. +     **    Suppress errors here -- we may be processing a different
  11063. +     **    job when we do the quit connection, and we don't want the 
  11064. +     **    new job to be penalized for something that isn't it's
  11065. +     **    problem.
  11066. +     */
  11067. +     SuprErrs = TRUE;
  11068.       /* send the quit message if we haven't gotten I/O error */
  11069.       if (mci->mci_state != MCIS_ERROR)
  11070.       {
  11071. ***************
  11072. *** 602,615 ****
  11073.           SmtpPhase = "client QUIT";
  11074.           smtpmessage("QUIT", m, mci);
  11075.           (void) reply(m, mci, e, TimeOuts.to_quit, NULL);
  11076.           if (mci->mci_state == MCIS_CLOSED)
  11077.               return;
  11078.       }
  11079.   
  11080.       /* now actually close the connection and pick up the zombie */
  11081. !     i = endmailer(mci, e, m->m_argv);
  11082. !     if (i != EX_OK)
  11083. !         syserr("451 smtpquit %s: stat %d", m->m_argv[0], i);
  11084.   }
  11085.    /*
  11086.   **  SMTPRSET -- send a RSET (reset) command
  11087. --- 627,644 ----
  11088.           SmtpPhase = "client QUIT";
  11089.           smtpmessage("QUIT", m, mci);
  11090.           (void) reply(m, mci, e, TimeOuts.to_quit, NULL);
  11091. +         SuprErrs = oldSuprErrs;
  11092.           if (mci->mci_state == MCIS_CLOSED)
  11093. +         {
  11094. +             SuprErrs = oldSuprErrs;
  11095.               return;
  11096. +         }
  11097.       }
  11098.   
  11099.       /* now actually close the connection and pick up the zombie */
  11100. !     (void) endmailer(mci, e, NULL);
  11101. !     SuprErrs = oldSuprErrs;
  11102.   }
  11103.    /*
  11104.   **  SMTPRSET -- send a RSET (reset) command
  11105. *** src/util.c.OLD    Sun Nov  7 11:14:47 1993
  11106. --- src/util.c    Tue Jan  4 06:40:38 1994
  11107. ***************
  11108. *** 33,39 ****
  11109.    */
  11110.   
  11111.   #ifndef lint
  11112. ! static char sccsid[] = "@(#)util.c    8.15 (Berkeley) 10/31/93";
  11113.   #endif /* not lint */
  11114.   
  11115.   # include "sendmail.h"
  11116. --- 33,39 ----
  11117.    */
  11118.   
  11119.   #ifndef lint
  11120. ! static char sccsid[] = "@(#)util.c    8.28 (Berkeley) 1/4/94";
  11121.   #endif /* not lint */
  11122.   
  11123.   # include "sendmail.h"
  11124. ***************
  11125. *** 407,413 ****
  11126.   **        gid -- group id to compare against.
  11127.   **        uname -- user name to compare against (used for group
  11128.   **            sets).
  11129. ! **        mustown -- to be safe, this uid must own the file.
  11130.   **        mode -- mode bits that must match.
  11131.   **
  11132.   **    Returns:
  11133. --- 407,415 ----
  11134.   **        gid -- group id to compare against.
  11135.   **        uname -- user name to compare against (used for group
  11136.   **            sets).
  11137. ! **        flags -- modifiers:
  11138. ! **            SFF_MUSTOWN -- "uid" must own this file.
  11139. ! **            SFF_NOSLINK -- file cannot be a symbolic link.
  11140.   **        mode -- mode bits that must match.
  11141.   **
  11142.   **    Returns:
  11143. ***************
  11144. *** 433,444 ****
  11145.   #endif
  11146.   
  11147.   int
  11148. ! safefile(fn, uid, gid, uname, mustown, mode)
  11149.       char *fn;
  11150.       uid_t uid;
  11151.       gid_t gid;
  11152.       char *uname;
  11153. !     bool mustown;
  11154.       int mode;
  11155.   {
  11156.       register char *p;
  11157. --- 435,446 ----
  11158.   #endif
  11159.   
  11160.   int
  11161. ! safefile(fn, uid, gid, uname, flags, mode)
  11162.       char *fn;
  11163.       uid_t uid;
  11164.       gid_t gid;
  11165.       char *uname;
  11166. !     int flags;
  11167.       int mode;
  11168.   {
  11169.       register char *p;
  11170. ***************
  11171. *** 446,453 ****
  11172.       struct stat stbuf;
  11173.   
  11174.       if (tTd(54, 4))
  11175. !         printf("safefile(%s, uid=%d, gid=%d, mustown=%d, mode=%o):\n",
  11176. !             fn, uid, gid, mustown, mode);
  11177.       errno = 0;
  11178.   
  11179.       for (p = fn; (p = strchr(++p, '/')) != NULL; *p = '/')
  11180. --- 448,455 ----
  11181.       struct stat stbuf;
  11182.   
  11183.       if (tTd(54, 4))
  11184. !         printf("safefile(%s, uid=%d, gid=%d, flags=%x, mode=%o):\n",
  11185. !             fn, uid, gid, flags, mode);
  11186.       errno = 0;
  11187.   
  11188.       for (p = fn; (p = strchr(++p, '/')) != NULL; *p = '/')
  11189. ***************
  11190. *** 455,460 ****
  11191. --- 457,468 ----
  11192.           *p = '\0';
  11193.           if (stat(fn, &stbuf) < 0)
  11194.               break;
  11195. +         if (uid == 0 && !bitset(SFF_ROOTOK, flags))
  11196. +         {
  11197. +             if (bitset(S_IXOTH, stbuf.st_mode))
  11198. +                 continue;
  11199. +             break;
  11200. +         }
  11201.           if (stbuf.st_uid == uid && bitset(S_IXUSR, stbuf.st_mode))
  11202.               continue;
  11203.           if (stbuf.st_gid == gid && bitset(S_IXGRP, stbuf.st_mode))
  11204. ***************
  11205. *** 488,494 ****
  11206. --- 496,507 ----
  11207.           return ret;
  11208.       }
  11209.   
  11210. + #ifdef HASLSTAT
  11211. +     if ((bitset(SFF_NOSLINK, flags) ? lstat(fn, &stbuf)
  11212. +                     : stat(fn, &stbuf)) < 0)
  11213. + #else
  11214.       if (stat(fn, &stbuf) < 0)
  11215. + #endif
  11216.       {
  11217.           int ret = errno;
  11218.   
  11219. ***************
  11220. *** 498,504 ****
  11221.           errno = 0;
  11222.           return ret;
  11223.       }
  11224. !     if (uid == 0)
  11225.           mode >>= 6;
  11226.       else if (stbuf.st_uid != uid)
  11227.       {
  11228. --- 511,527 ----
  11229.           errno = 0;
  11230.           return ret;
  11231.       }
  11232. ! #ifdef S_ISLNK
  11233. !     if (bitset(SFF_NOSLINK, flags) && S_ISLNK(stbuf.st_mode))
  11234. !     {
  11235. !         if (tTd(54, 4))
  11236. !             printf("\t[slink mode %o]\tEPERM\n", stbuf.st_mode);
  11237. !         return EPERM;
  11238. !     }
  11239. ! #endif
  11240. !     if (uid == 0 && !bitset(SFF_ROOTOK, flags))
  11241.           mode >>= 6;
  11242.       else if (stbuf.st_uid != uid)
  11243.       {
  11244. ***************
  11245. *** 525,531 ****
  11246.       if (tTd(54, 4))
  11247.           printf("\t[uid %d, stat %o, mode %o] ",
  11248.               stbuf.st_uid, stbuf.st_mode, mode);
  11249. !     if ((stbuf.st_uid == uid || uid == 0 || !mustown) &&
  11250.           (stbuf.st_mode & mode) == mode)
  11251.       {
  11252.           if (tTd(54, 4))
  11253. --- 548,555 ----
  11254.       if (tTd(54, 4))
  11255.           printf("\t[uid %d, stat %o, mode %o] ",
  11256.               stbuf.st_uid, stbuf.st_mode, mode);
  11257. !     if ((stbuf.st_uid == uid || stbuf.st_uid == 0 ||
  11258. !          !bitset(SFF_MUSTOWN, flags)) &&
  11259.           (stbuf.st_mode & mode) == mode)
  11260.       {
  11261.           if (tTd(54, 4))
  11262. ***************
  11263. *** 836,847 ****
  11264.   
  11265.       /* try to read */
  11266.       p = NULL;
  11267. !     while (p == NULL && !feof(fp) && !ferror(fp))
  11268.       {
  11269.           errno = 0;
  11270.           p = fgets(buf, siz, fp);
  11271. !         if (errno == EINTR)
  11272. !             clearerr(fp);
  11273.       }
  11274.   
  11275.       /* clear the event if it has not sprung */
  11276. --- 860,872 ----
  11277.   
  11278.       /* try to read */
  11279.       p = NULL;
  11280. !     while (!feof(fp) && !ferror(fp))
  11281.       {
  11282.           errno = 0;
  11283.           p = fgets(buf, siz, fp);
  11284. !         if (p != NULL || errno != EINTR)
  11285. !             break;
  11286. !         clearerr(fp);
  11287.       }
  11288.   
  11289.       /* clear the event if it has not sprung */
  11290. ***************
  11291. *** 1120,1137 ****
  11292.       register char *a;
  11293.       register char *b;
  11294.   {
  11295. !     int l;
  11296.   
  11297. !     l = strlen(a);
  11298. !     for (;;)
  11299.       {
  11300. !         b = strchr(b, a[0]);
  11301. !         if (b == NULL)
  11302. !             return FALSE;
  11303. !         if (strncmp(a, b, l) == 0)
  11304.               return TRUE;
  11305. -         b++;
  11306.       }
  11307.   }
  11308.    /*
  11309.   **  CHECKFD012 -- check low numbered file descriptors
  11310. --- 1145,1167 ----
  11311.       register char *a;
  11312.       register char *b;
  11313.   {
  11314. !     int la;
  11315. !     int lb;
  11316. !     int c;
  11317.   
  11318. !     la = strlen(a);
  11319. !     lb = strlen(b);
  11320. !     c = *a;
  11321. !     if (isascii(c) && isupper(c))
  11322. !         c = tolower(c);
  11323. !     for (; lb-- >= la; b++)
  11324.       {
  11325. !         if (*b != c && isascii(*b) && isupper(*b) && tolower(*b) != c)
  11326. !             continue;
  11327. !         if (strncasecmp(a, b, la) == 0)
  11328.               return TRUE;
  11329.       }
  11330. +     return FALSE;
  11331.   }
  11332.    /*
  11333.   **  CHECKFD012 -- check low numbered file descriptors
  11334. ***************
  11335. *** 1279,1284 ****
  11336. --- 1309,1335 ----
  11337.           p += strlen(p);
  11338.           goto defprint;
  11339.   
  11340. + #ifdef S_IFIFO
  11341. +       case S_IFIFO:
  11342. +         sprintf(p, "FIFO: ");
  11343. +         p += strlen(p);
  11344. +         goto defprint;
  11345. + #endif
  11346. + #ifdef S_IFDIR
  11347. +       case S_IFDIR:
  11348. +         sprintf(p, "DIR: ");
  11349. +         p += strlen(p);
  11350. +         goto defprint;
  11351. + #endif
  11352. + #ifdef S_IFLNK
  11353. +       case S_IFLNK:
  11354. +         sprintf(p, "LNK: ");
  11355. +         p += strlen(p);
  11356. +         goto defprint;
  11357. + #endif
  11358.         default:
  11359.   defprint:
  11360.           sprintf(p, "dev=%d/%d, ino=%d, nlink=%d, u/gid=%d/%d, size=%ld",
  11361. ***************
  11362. *** 1289,1295 ****
  11363.   
  11364.   printit:
  11365.       if (logit)
  11366. !         syslog(LOG_INFO, "%s", buf);
  11367.       else
  11368.           printf("%s\n", buf);
  11369.   }
  11370. --- 1340,1395 ----
  11371.   
  11372.   printit:
  11373.       if (logit)
  11374. !         syslog(LOG_DEBUG, "%s", buf);
  11375.       else
  11376.           printf("%s\n", buf);
  11377. + }
  11378. +  /*
  11379. + **  SHORTENSTRING -- return short version of a string
  11380. + **
  11381. + **    If the string is already short, just return it.  If it is too
  11382. + **    long, return the head and tail of the string.
  11383. + **
  11384. + **    Parameters:
  11385. + **        s -- the string to shorten.
  11386. + **        m -- the max length of the string.
  11387. + **
  11388. + **    Returns:
  11389. + **        Either s or a short version of s.
  11390. + */
  11391. + #ifndef MAXSHORTSTR
  11392. + # define MAXSHORTSTR    203
  11393. + #endif
  11394. + char *
  11395. + shortenstring(s, m)
  11396. +     register char *s;
  11397. +     int m;
  11398. + {
  11399. +     int l;
  11400. +     static char buf[MAXSHORTSTR + 1];
  11401. +     l = strlen(s);
  11402. +     if (l < m)
  11403. +         return s;
  11404. +     if (m > MAXSHORTSTR)
  11405. +         m = MAXSHORTSTR;
  11406. +     else if (m < 10)
  11407. +     {
  11408. +         if (m < 5)
  11409. +         {
  11410. +             strncpy(buf, s, m);
  11411. +             buf[m] = '\0';
  11412. +             return buf;
  11413. +         }
  11414. +         strncpy(buf, s, m - 3);
  11415. +         strcpy(buf + m - 3, "...");
  11416. +         return buf;
  11417. +     }
  11418. +     m = (m - 3) / 2;
  11419. +     strncpy(buf, s, m);
  11420. +     strcpy(buf + m, "...");
  11421. +     strcpy(buf + m + 3, s + l - m);
  11422. +     return buf;
  11423.   }
  11424. *** src/version.c.OLD    Tue Nov 30 08:59:46 1993
  11425. --- src/version.c    Thu Jan 13 06:41:44 1994
  11426. ***************
  11427. *** 33,39 ****
  11428.    */
  11429.   
  11430.   #ifndef lint
  11431. ! static char sccsid[] = "@(#)version.c    8.6.1.4 (Berkeley) 10/31/93";
  11432.   #endif /* not lint */
  11433.   
  11434. ! char    Version[] = "8.6.4";
  11435. --- 33,39 ----
  11436.    */
  11437.   
  11438.   #ifndef lint
  11439. ! static char sccsid[] = "@(#)version.c    8.6.1.5 (Berkeley) 1/13/94";
  11440.   #endif /* not lint */
  11441.   
  11442. ! char    Version[] = "8.6.5";
  11443.